X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Pinterest (https://forum.x-cart.com/showthread.php?t=62293)

MSfan 01-10-2012 05:54 PM

Pinterest
 
I know a number of you have probably never heard of pinterest.com... I've only heard about it recently. It is a website where members can 'pin' images of things they like (visual bookmarks). It seems a bit like 'liking' something on Facebook, but members see visual representations of each thing they've pinned, and they can group them into categories. It is integrated with Facebook and Twitter somehow. I'm still learning about it, but it seems like a great way to get exposure to your ecommerce site.

If members 'pin' an item from your store, it's kind of like free publicity. Not only will the member see/remember it, but their followers will see it as well. But how can I modify my files so it will include this in the product description (dynamically)? It needs a URL and an image for each product. Would someone know how to write the php that pulls this info?

Here is a (non X-cart) store that has the Pin It button on their products. http://www.youcanmakethis.com/products/holidays/baking-memories-tea-towel-gingerbread-design.htm

Sorry if I've posted in the wrong forum... please move if needed.

Thanks

Toora Designs 01-10-2012 10:17 PM

Re: Pinterest
 
That is really interesting

You can see here http://help.qtmsoft.com/index.php?title=X-Cart:Adding_Facebook_Like_button_to_your_X-Cart_store the way QT adds the facebook mod there and I think you can edit the same files

here is a code for pin interest http://pinterest.com/about/goodies/

If you need professional help let me know :)

cherie 01-11-2012 01:19 PM

Re: Pinterest
 
Quote:

Originally Posted by MSfan
how can I modify my files so it will include this in the product description (dynamically)? It needs a URL and an image for each product.

Here is a Smarty code snippet for 4.3 used with addthis that might point you in the right direction:
PHP Code:

{if $main eq "product"}
    {
assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.REQUEST_URI`"}
    {
assign var=pinitmedia value=$product.images.T.url}
{elseif 
$main eq "catalog" and $current_category.category}
    {
assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.REQUEST_URI`"}
    {if 
$current_category.icon_url}
        {
assign var=pinitmedia value=$current_category.icon_url}
    {/if}
{/if}
<
class="addthis_button_pinterest"{if $piniturlpi:pinit:url="{$piniturl}"{/if}{if $pinitmediapi:pinit:media="{$pinitmedia}"{/if} pi:pinit:layout="horizontal"></a


MSfan 01-11-2012 01:41 PM

Re: Pinterest
 
Oh wow, thank you! That got me 99% of the way there. The only thing missing is a description when the pinterest pop up comes up. It would be nice to pre-populate it with the name of the product.

Toora Designs 01-11-2012 01:58 PM

Re: Pinterest
 
For name you could use
Code:

{$product.producttitle|default:$product.product|escape}

MSfan 01-11-2012 02:29 PM

Re: Pinterest
 
Get this, I've been testing with cherie's code for the last 20 minutes or so.... and somebody already repinned my test pin (which was of the 3 diamond princess cut ring that comes with the demo). That is too funny! Here I thought nobody sees my site since I'm just in test mode and it reached an audience before I even intended. The power of social media...

Anyway, thanks for the code for the product title. I found part of that (just without the default value). However I can't seem to add it to the url.

I was able to populate a variable like this:
{assign var=pinitdesc value=$product.producttitle}

I tried adding this to the <a> tag:

{if $pinitdesc} pi:pinit:description="{$pinitdesc}"{/if}

but it doesn't work.. it doesn't add it to the url. However, if I hardcode &description=this%20%is%20a%20test to the url, it works fine. I guess "pi:pinit:description" isn't the right syntax.

Toora Designs 01-11-2012 02:46 PM

Re: Pinterest
 
Code:

{assign var=pinitmedia value=$product.images.T.url}
{assign var=pinitmedia value=$product.producttitle}


Something like that

MSfan 01-11-2012 02:54 PM

Re: Pinterest
 
Thanks - I'm able to populate the variable okay (I basically did a print statement to validate). It's adding it to the hyperlink tag that is the issue

I tried this but it does not work. I'm guessing there is an error with the part in red. I must not be using the correct syntax.

Code:

<a class="addthis_button_pinterest"{if $piniturl} pi:pinit:url="{$piniturl}"{/if}{if $pinitmedia} pi:pinit:media="{$pinitmedia}"{/if} {if $pinitdesc} pi:pinit:description="{$pinitdesc}"{/if} pi:pinit:layout="horizontal"></a>

bobweasel 02-13-2012 01:35 PM

Re: Pinterest
 
Quote:

Originally Posted by MSfan
I tried this but it does not work. I'm guessing there is an error with the part in red. I must not be using the correct syntax.

Code:

<a class="addthis_button_pinterest"{if $piniturl} pi:pinit:url="{$piniturl}"{/if}{if $pinitmedia} pi:pinit:media="{$pinitmedia}"{/if} {if $pinitdesc} pi:pinit:description="{$pinitdesc}"{/if} pi:pinit:layout="horizontal"></a>


Did you figure this out yet? I'm stuck with the same problem. I need to populate the Product Title in the description, but can't figure out how!

balinor 02-14-2012 06:22 AM

Re: Pinterest
 
Try this for the product detail page:

Code:

<a href="http://pinterest.com/pin/create/button/?url={php}echo urlencode('http://www.yoururlhere.com' . $_SERVER['REQUEST_URI']);{/php}&media={$product.tmbn_url}&description={$product.producttitle}" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>



All times are GMT -8. The time now is 04:17 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.