Jump to content

Replying to Shortcode For Exchange?

Post Options

  or Cancel

Topic Summary


Posted 10 November 2014 - 02:36 PM

Hi James,

in the code provided earlier in this topic, you can edit the parameters for the 'get-purchase-options' and override the standard label using the 'add-to-cart-label' parameter, e.g. "Add to Cart" is changed to "Get this" using the following code:

it_exchange( 'product', 'get-purchase-options', array( 'add-to-cart-label' => 'Get this', 'add-to-cart-edit-quantity' => false, 'buy-now-edit-quantity' =>true ) );

That might be a clue,

As for changing the color, that may be done using css, but I am not sure if there is a class for the "clicked" state, you should inspect your site, FIrebug is recommended.

Also, please (always) add a link to your site so we can look into this if need be,



Posted 08 November 2014 - 03:43 AM

Thanks for this snippet! It's working really well for me to be able to setup a custom purchases-page for customers to "build their own product" a la carte.

Is there a hook or filter that I can use to change the "Add to Cart" button text? Ideally I'd like to use a function that I can use conditional tags to apply:

add_filter ( 'FILTER HERE', 'change_button_text_sometimes' );
function change_button_text_sometimes() {
if ( is_page( 'id') ) {

*Function Here*


Also - is there any way to change the color of the button after it's been clicked? Right now, my superwidget is at the footer, and the button is over the fold, so people may click and see no change and become confused about whether they've successfully purchased or not. If I have to do so, I am comfortable doing some jQuery to make it happen. (Although that's obviously not desirable.)



Posted 31 October 2014 - 01:37 PM

Hi Ronald...  I'm still trying to troubleshoot this if possible because I really need to make it work...  

I notice the difference between when this button functions and when the regular product page button functions is that the button on it's own tries to reload the page and add to the url...  It has added things like...  '/?ite-sw-state=checkout' or '/?ite-sw-state=login'.  When the regular product page button functions it just updates the content in the little window without reloading the page, etc.

Does that bit of information help in troubleshooting this at all?


Posted 30 October 2014 - 04:37 PM

No sweat Ronald...  Thank you for doing what you did.

I guess we will leave it as a mystery why the button is reloading the page (with '/?ite-sw-state=checkout') when clicked but nothing seems to change - like a purchase button or screen showing...

Thanks any way.


Posted 30 October 2014 - 04:03 PM


unfortunately, currently, this is "the best" I can do given the way Exchange works. I know that the dev's are working on/planning to work on an integrated solution in Exchange, I have no ETA on when this will be implemented though,



Posted 30 October 2014 - 12:04 PM

Thanks Roland for this shortcode.  Once implemented into exchange fully it will be very handy.

Unfortunately, after adding the code as mentioned to a button on our front page, when clicked the page reloads adding '/?ite-sw-state=checkout' to the url but nothing else changes on the page/buy button...  Any thoughts?

Please note this is a membership item, if that makes any difference.  Also, if possible to just have the stripe window popup when the buy button is clicked that is the desired outcome - instead of having to again press the Purchase button.

Thank you!

Elise Alley

Posted 26 September 2014 - 04:32 PM

Hi Craig,

Can you please start a new post for this.  We'd be happy to help you out, but it's unrelated to the original post and it helps to keep the threads to one topic.

When you create your new post, please be sure to include a link to your site.




Posted 26 September 2014 - 04:28 PM

Hi Again... @Ronald or anyone else who may have time to help. Can you please help me with the code to turn Buy now button to Green with white font, sign me up button to Orange with Black Font and "add to cart" button changed to Amazon Yellow with black font... Please? I will really really appreciate it. Thanks in Advance.


Posted 21 September 2014 - 07:52 PM

Thanks Guys very much for your help. I really appreciate it.


Posted 19 September 2014 - 03:49 PM

Hi Craig... out the door for the weekend, so a quick reply...

I used the last code as noted... and was wrapped in <?php and before any closing ?>... nothing else in the file.  Stephen

my_it_exchange_add_to_cart($atts) {

                 "product_id" => null
), $atts));

it_exchange_set_product( $product_id );

$output = "<div class='my_it_itemdescription'>Item: " . it_exchange( 'product', 'get-description' ) . "</div>";
$output .= "<div class='my_it_price'>Price: " . it_exchange( 'product', 'get-base-price' ) . "</div>";
$output .= "<div class='my_it_buy-now'>" .it_exchange( 'product', 'get-purchase-options', array( 'add-to-cart-edit-quantity' => true, 'buy-now-edit-quantity' =>true ) ) . "</div>";

return $output;
add_shortcode( 'add-to-cart', 'my_it_exchange_add_to_cart' );

Review the complete topic (launches new window)