Developer forum

Forum » Ecommerce - Standard features » Custom share on cart url

Custom share on cart url

Michael John
Reply

Hi,

 

On this event, when you click Sign Up, the event is added to the cart. On the checkout page, I want to add an facebook share, which also seems to work.

The problem is, when I share the page, and go to facebook and click on the link, the cart is empty, and not added to the cart.

 

My code is:

                        <div class="fbshare">
                            <a href="https://www.facebook.com/sharer/sharer.php?u=internationalcommunity.dk/Default.aspx?ID=<!--@Ecom:Product:Page.ID-->%26ProductID=<!--@Ecom:Order:OrderLine.ProductID-->&title=<!--@Ecom:Order:OrderLine.ProductName-->&CartCmd=add" target="_blank">Share on Facebook</a>
                        </div>

Where I first take the Ecom:Product:Page.ID and Ecom:Order:OrderLine.ProductID inside the orderlines loop with the CartCmd=add, to force the product to be added to the cart.

 

What am I doing wrong?

 

Thanks!

 


Replies

 
Nicolai Pedersen
Reply

Hi Michael

You have %26 in your URL that should be a &

 
Michael John
Reply

Hi Nicolai,

 

I've changed it, but somehow the cart is still empty when using the facebook link.

 

 
Nicolai Pedersen
Reply

Hm, you have to debug your way... Going Incognito in Chrome, and following the URL: http://internationalcommunity.dk/Default.aspx?ID=1005&ProductID=PROD615&title=Byen%20m%C3%B8der%20Borgen&CartCmd=add will add the event to the cart and redirect me to the cart page, see dump.

 

In the URL you have a title querystring parameter that you give a title with spaces. Make sure it is URL encoded or spaces replaced with +. Could be it.

Capture.PNG

 

You must be logged in to post in the forum