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>


cedaly1968 03-13-2012 08:23 AM

Re: Pinterest
 
This is what I ended up having for my Pinterest Code... leveraged Cherie's code:

<!-- Pinterest Code -->
<!-- Include ONCE for ALL buttons in the page -->
<script type="text/javascript">
(function() {
window.PinIt = window.PinIt || { loaded:false };
if (window.PinIt.loaded) return;
window.PinIt.loaded = true;
function async_load(){
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
if (window.location.protocol == "https:")
s.src = "https://assets.pinterest.com/js/pinit.js";
else
s.src = "http://assets.pinterest.com/js/pinit.js";
var x = document.getElementsByTagName("script")[0];
x.parentNode.insertBefore(s, x);
}
if (window.attachEvent)
window.attachEvent("onload", async_load);
else
window.addEventListener("load", async_load, false);
})();
</script>

{if $main eq "product"}
{assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.R EQUEST_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.R EQUEST_URI`"}
{if $current_category.icon_url}
{assign var=pinitmedia value=$current_category.icon_url}
{/if}
{/if}
<a class="addthis_button_pinterest"{if $piniturl} pi:pinit:url="{$piniturl}"{/if}{if $pinitmedia} pi:pinit:media="{$pinitmedia}"{/if} pi:pinit:layout="horizontal"></a>

<a href="http://pinterest.com/pin/create/button/&url={$piniturl}&media={$pinitmedia}" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
<br></br>
<!-- End Pinterest Code -->

MSfan 03-17-2012 03:11 PM

Re: Pinterest
 
Quote:

Originally Posted by cedaly1968
This is what I ended up having for my Pinterest Code... leveraged Cherie's code:

<!-- Pinterest Code -->
<!-- Include ONCE for ALL buttons in the page -->
<script type="text/javascript">
(function() {
window.PinIt = window.PinIt || { loaded:false };
if (window.PinIt.loaded) return;
window.PinIt.loaded = true;
function async_load(){
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
if (window.location.protocol == "https:")
s.src = "https://assets.pinterest.com/js/pinit.js";
else
s.src = "http://assets.pinterest.com/js/pinit.js";
var x = document.getElementsByTagName("script")[0];
x.parentNode.insertBefore(s, x);
}
if (window.attachEvent)
window.attachEvent("onload", async_load);
else
window.addEventListener("load", async_load, false);
})();
</script>

{if $main eq "product"}
{assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.R EQUEST_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.R EQUEST_URI`"}
{if $current_category.icon_url}
{assign var=pinitmedia value=$current_category.icon_url}
{/if}
{/if}
<a class="addthis_button_pinterest"{if $piniturl} pi:pinit:url="{$piniturl}"{/if}{if $pinitmedia} pi:pinit:media="{$pinitmedia}"{/if} pi:pinit:layout="horizontal"></a>

<a href="http://pinterest.com/pin/create/button/&url={$piniturl}&media={$pinitmedia}" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
<br></br>
<!-- End Pinterest Code -->


Does it populate the description?

eknee 03-22-2012 11:50 AM

Re: Pinterest
 
Does anyone see a problem with this?
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.coffee-authority.com/product.php?productid={$product.productid}&ref=pin terest{$product.productid}&media={$product.image_u rl}&description={$product.product}" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>

It's for x-cart version 4.1.11

Here's a product page that includes the link. This worked fine for a while, but suddenly stopped. I've no clue why.

http://www.coffee-authority.com/big-train-blended-ice-coffee-java-chip-3.5lb-bulk-bag.html

balinor 03-22-2012 12:08 PM

Re: Pinterest
 
Yea, use what I posted, the second question mark from your url is botching it up, which is why you need to use the urlencode url. Here it is again:

Code:

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


eknee 03-22-2012 12:17 PM

Re: Pinterest
 
Yep, that did it. Thanks very much.

Sara 04-10-2012 01:31 PM

Re: Pinterest
 
Could something similar be added to the socialize module or is it best to wait until X-Cart officially adds it? I do have an add-this snippet on my site but I would assume adding it with the rest of them is best.

spiredem 04-12-2012 03:34 PM

Re: Pinterest
 
Forgive my ignorance but in what file am I pasting this code in order to make it appear on all product details pages?

cflsystems 04-12-2012 03:52 PM

Re: Pinterest
 
product.tpl

spiredem 04-12-2012 03:58 PM

Re: Pinterest
 
I pasted it into my product.tpl and it does grab the product name, but not the image.

spiredem 04-12-2012 04:14 PM

Re: Pinterest
 
I see! My image is

$product.tmbn_url_P
not
$product.image_url

got it!

David-Allan 04-19-2012 01:41 AM

Re: Pinterest
 
I dont want to sound like I am trying to put a pin in your bubble but is the pinterest traffic really worth it?

I'd love to see some data from the conversions of this traffic, I can see it bringing in lots of traffic to your server but how much of this traffic actually converts to sales?

Yes its great getting lots of traffic to your site but if that traffic is only interested in looking at your pictures or more likely stealing your pictures how much actually converts to real sales of products. I cant see anyone using pinterest to find products to buy rather than using a search engine.

Just seems like a waste of time to me but I look forward to someone proving me i'm wrong

balinor 04-19-2012 05:56 AM

Re: Pinterest
 
Hi David, not a waste of time at all. It is now the #3 social media site out there with 23.7 MILLION users in February. Even if the initial 'hit' on your site doesn't produce a sale, that is a potential customer down the road. A lot of people use Pinterest as a 'shopping list' - so they add the pin, and come back later to purchase. IMHO it would be foolish to NOT put this on your site.

David-Allan 04-24-2012 04:29 AM

Re: Pinterest
 
Quote:

Originally Posted by balinor
Hi David, not a waste of time at all. It is now the #3 social media site out there with 23.7 MILLION users in February. Even if the initial 'hit' on your site doesn't produce a sale, that is a potential customer down the road. A lot of people use Pinterest as a 'shopping list' - so they add the pin, and come back later to purchase. IMHO it would be foolish to NOT put this on your site.


I understand what your saying, I have actually opened up an account for our company and have some of our products on it. I just can't see it working.

I guess like any social network it takes lots of work and its really all about brand awareness rather than the physical sales from the site. It would be nice to see some stats as to conversions from it though.

I do see your point that it has lots of users and I guess some of these may convert at a later date based on them getting to know about your product.

I'm still not convinced though, I can see why google+ works for tech companies and facebook works for some industries too but I just can't see this working for ours to be honest.

masada3336 11-18-2012 06:58 PM

Re: Pinterest
 
Balinor, this is great - it's now working for me! However, the watermarked image is being bypassed for this, which I really don't want. What should the url of the watermarked image be?
Thanks!

Quote:

Originally Posted by balinor
Yea, use what I posted, the second question mark from your url is botching it up, which is why you need to use the urlencode url. Here it is again:

Code:

<a href="http://pinterest.com/pin/create/button/?url={php}echo urlencode('http://www.yoururlhere.com' . $_SERVER['REQUEST_URI']);{/php}&media={$product.image_url}&description={$product.product}" 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 11:19 PM.

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