[Plugin: WordPress Simple Paypal Shopping Cart] add variation control in php
-
I’m working with the plugin WordPress Simple Paypal Shopping Cart.
I try to integrate the “add to cart button” in my single.php file with variation control.
with shortcodes it works like this :
[wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:var1[VARIATION-NAME|VARIATION1|VARIATION2|VARIATION3]:end]
so with shortcodes I can do that (choose the color of any product) :
[wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:var1[color|red|blue|yellow]:end]
but in my single.php file the plugin isn’t ready to use variation control with php.
<?php echo print_wp_cart_button_for_product(’product name’,price); ?>
I’ve tried the “do_shortcode” solution to execute a shortcode in my template file
<?php echo do_shortcode('[wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:var1[color|red|blue|yellow]:end]'); ?>
but it simply return [wp_cart:PRODUCT-NAME:price:PRODUCT-PRICE:var1[color|red|blue|yellow]:end]
How can I add variation control to any template file in php ?
- The topic ‘[Plugin: WordPress Simple Paypal Shopping Cart] add variation control in php’ is closed to new replies.