PluginProbe
Welcart e-Commerce / 2.12.3
Welcart e-Commerce v2.12.3
2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 291 releases
usc-e-shop / functions / shortcode.php

shortcode.php in Welcart e-Commerce 2.12.3, at functions/shortcode.php

35 lines 606 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shortcode.
4 *
5 * @package Welcart
6 */
7
8 /**
9 * Direct into cart.
10 *
11 * @param array $atts Attributes.
12 * @return usces_direct_intoCart
13 */
14 function sc_direct_intoCart( $atts ) {
15 global $usces;
16 extract(
17 shortcode_atts(
18 array(
19 'item' => '',
20 'sku' => '',
21 'value' => null,
22 'options' => null,
23 ),
24 $atts
25 )
26 );
27
28 if ( WCUtils::is_blank( $item ) || WCUtils::is_blank( $sku ) ) {
29 return '';
30 }
31 $post_id = $usces->get_ID_byItemName( $item );
32
33 return usces_direct_intoCart( $post_id, $sku, true, $value, $options, 'return' );
34 }
35