# usc-e-shop/2.12.4/functions/shortcode.php

Welcart e-Commerce, version 2.12.4. 35 lines.

- Page: https://pluginprobe.com/plugins/usc-e-shop/2.12.4/code/functions/shortcode.php
- Raw: https://pluginprobe.com/plugins/usc-e-shop/2.12.4/raw/functions/shortcode.php
- Modified: 2024-11-19T04:56:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/usc-e-shop/2.12.4/code/functions/shortcode.php#L10-L20`.

```php
<?php
/**
 * Shortcode.
 *
 * @package Welcart
 */

/**
 * Direct into cart.
 *
 * @param array $atts Attributes.
 * @return usces_direct_intoCart
 */
function sc_direct_intoCart( $atts ) {
	global $usces;
	extract(
		shortcode_atts(
			array(
				'item'    => '',
				'sku'     => '',
				'value'   => null,
				'options' => null,
			),
			$atts
		)
	);

	if ( WCUtils::is_blank( $item ) || WCUtils::is_blank( $sku ) ) {
		return '';
	}
	$post_id = $usces->get_ID_byItemName( $item );

	return usces_direct_intoCart( $post_id, $sku, true, $value, $options, 'return' );
}

```
