WordPress.org

Support

Support » Plugins and Hacks » WordPress Ultra Simple Paypal Shopping Cart » [Resolved] [Plugin: WordPress Ultra Simple Paypal Shopping Cart] Add to Cart button with variation in theme fil

[Resolved] [Plugin: WordPress Ultra Simple Paypal Shopping Cart] Add to Cart button with variation in theme fil

  • Love this plugin! It’s already saved my bacon on a new site I’m working on.

    Curious as to how I can add an Add to Cart button with variations in my theme files, though?

    I would have though I could just do this:

    <?php echo do_shortcode("[wp_cart:Product Name:price:150:var1[Color|Black|Granite|Rust]:end]"); ?>

    but for some reason, that doesn’t work?

    Basically just looking for something like this:

    <?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>

    with the ability to add variations… Any suggestions? Thanks again!

    http://wordpress.org/extend/plugins/wp-ultra-simple-paypal-shopping-cart/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Castro Demaria

    @mikecastrodemaria

    Hello B1gJ4k3,

    The template code is currently limited, I need to improve it to do the same possibilities than the sort code.

    Use feature request from the support forum, and you will be warn when it will be done : http://www.ultra-prod.com/developpement-support/

    Cheers,
    Mike

    Thanks for getting back to me Mike. I actually ended up figuring this out a different way. Here’s the code in case any one else has a similar question. It seems to work:

    <?php if( get_field('the_price') ) {
    	$price = get_field('the_price');
    	echo '<div id="price">$' . $price . '</div>';
    } ?>
    
    <?php if( get_field('the_colors') ) {
    	$colors = implode('|', get_field('the_colors'));
    
    <?php $title = get_the_title(); ?>
    
    <?php
    if ( function_exists('print_wp_cart_button_for_product') && $price && $colors) {
    	echo apply_filters( 'the_content', '[wp_cart:' . $title . ':price:' . $price . ':var1[Color|' . $colors .']:end]' );
    } ?>
    Plugin Author Mike Castro Demaria

    @mikecastrodemaria

    Thanks for the trick .

    I add it to Ultra-Prod support forum. It show me the way to improve simply this feature.

    Thanks for your feedback.
    Mike

    Could this be used to let the customer add some custom text (or in my case a date from a text field) as a variable? So instead of a dropdown there is a text input?

    I’ve been testing for a while but can’t figure it out.

    Or is there a way I can just append some text to the title?

    Thanks for any help anyone can suggest 🙂

    p.s. Just realised I have kind of asked 2 questions here so I have copied the 2nd part of my question to a separate thread:

    Re: appending text to title from form input:

    http://wordpress.org/support/topic/append-text-from-input-to-product-title?replies=1#post-3649592

    Plugin Author Mike Castro Demaria

    @mikecastrodemaria

    HI PinkishHue,

    Please add feature request on ultra-prod.com forum. I’m using it each time I do an update as to do list.

    Cheers,
    Mike

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: WordPress Ultra Simple Paypal Shopping Cart] Add to Cart button with variation in theme fil’ is closed to new replies.
Skip to toolbar