-
creinold Pinterest Button Addon
This is the support board for creinold Pinterest Button add on submitted to the Zen-Cart add on site 3/9/2012.
This modification adds the advance Pinterest codes to your product info page. You can place the code anywhere you like on the product information page. My sample tpl_product_info_display.php puts the Pin It button right above the product title next to the Main Image.
-
Re: creinold Pinterest Button Addon
-
Re: creinold Pinterest Button Addon
Ok as the Contribution hasn't been approved yet i can't test it out myself, But on your site, the text "pin it" appears and then a few seconds later it is replace by a "pin it" Button, is that normal?
-
Re: creinold Pinterest Button Addon
Yeah... Has to do with the Pinterest servers.
Update: Had to resubmit the contribution. Forgot GPL license.... DUH!
-
Re: creinold Pinterest Button Addon
It's added to contribution area.
http://www.zen-cart.com/index.php?ma...oducts_id=2079
Note: in the java script file I accidents left some Facebook coding. (Another add on button I'm working on for later update.) You can remove it or leave it. It does no harm.
-
Re: creinold Pinterest Button Addon
This add on will also work with older version if Zen-Cart.
-
Re: creinold Pinterest Button Addon
Thank you for this module.
I am having a bit of trouble. I merged everything like I was supposed to and I put the code where I wanted it in my tpl_product_info_display.php but my description page looks like this: http://frompropertorocker.com/easter...et-p-3318.html where by the quantity it shows double the description and a code for the pin-it-button.
Did I miss a step? I have re read the instructions a few times but I know I am missing something.
Thanks in advance! Oh I am using v1.3.9h
I just seen it was for v1.5.0 will it still work for my version
-
Re: creinold Pinterest Button Addon
can you paste your tpl_product_info_display.php so I can see what's going on?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
can you paste your tpl_product_info_display.php so I can see what's going on?
Sure! It's
PHP Code:
<?php
/**
* Page Template
*
* Loaded automatically by index.php?main_page=product_info.<br />
* Displays details of a typical product
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_product_info_display.php 16242 2010-05-08 16:05:40Z ajeh $
*/
//require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
?>
<div class="centerColumn" id="productGeneral">
<!--bof Form start-->
<?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?>
<!--eof Form start-->
<?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?>
<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
* display the category icons
*/
require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
<?php } ?>
<!--eof Category Icon -->
<!--bof Prev/Next top position -->
<?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
<?php
/**
* display the product previous/next helper
*/
require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
<?php } ?>
<!--eof Prev/Next top position-->
<!--bof Main Product Image -->
<?php
if (zen_not_null($products_image)) {
?>
<?php
/**
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
<?php
}
?>
<!--eof Main Product Image-->
<!--bof Product Name-->
<h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>
<!--eof Product Name-->
<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<!--eof Product Price block -->
<!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
<br class="clearBoth" />
<!--bof Product date added/available-->
<?php
if ($products_date_available > date('Y-m-d H:i:s')) {
if ($flag_show_product_info_date_available == 1) {
?>
<p id="productDateAvailable" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_AVAILABLE, zen_date_long($products_date_available)); ?></p>
<?php
}
} else {
if ($flag_show_product_info_date_added == 1) {
?>
<p id="productDateAdded" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_ADDED, zen_date_long($products_date_added)); ?></p>
<?php
} // $flag_show_product_info_date_added
}
?>
<!--eof Product date added/available -->
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
?>
<?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty;
echo $display_button;
?>
<!-- AddThis Button END -->
<!--bof free ship icon -->
<?php if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
<div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
<?php } ?>
<!--eof free ship icon -->
<!-- BEGIN MyGiftList Code -->
<div id="registry">
<input type="image" onclick='javascript:zenMGLpopup(this.form,"FROMPROP2405","From Proper to Rocker","zen-cart");return false;' src="http://www.frompropertorocker.com/images/add.gif" width=118 height=35 border=0 alt="Click to Add to your Registry">
<textarea rows=1 cols=10 name=giftName style="display:none"><?php echo $products_name; ?></textarea>
<input type=hidden name=giftPrice value="<?php echo $specials_price ? $specials_price : $products_price; ?>">
<textarea rows=1 cols=10 name=giftDescription style="display:none"><?php echo $products_model . " " . Stripslashes(substr($products_description,0,50)); ?></textarea>
<input type=hidden name=giftImage value='<?php echo DIR_WS_IMAGES . $products_image; ?>'>
<script language=javascript>
function zenMGLpopup(f, refsource, storename, cartname) {
var giftPrice = "";
var giftName = "";
var giftDescription = "";
var m;
var u = "";
var n;
if (f) {
giftPrice = f.giftPrice.value;
giftName = f.giftName.value;
giftDescription = f.giftDescription.value;
for (var i = 0; i < f.elements.length; i++) {
m = f.elements[i].selectedIndex;
n = f.elements[i].name
if (m > -1) {
u = u + f.elements[i].options[m].text + ", ";
}
if (f.elements[i].name == "cart_quantity" ) {
u = u + "Quantity=" + f.elements[i].value + ", ";
}
}
}
if ( u != "" ) {
u = u.substr(0, u.length-2);
u = "I would like these options: " + u;
giftDescription = u + ". " + giftDescription;
}
u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(document.URL) + "&giftName=" + escape(giftName) + "&giftRetailer=" + escape(storename) + "&giftCart=" + escape(cartname) + "&giftPrice=" + escape(giftPrice) + "&giftDescription=" + escape(giftDescription);
var mgl = window.open(u,"MGL","width=720,height=500,top=60,left=100,resizable,scrollbars");
}
</script>
</div>
<!-- End MyGiftList Code -->
<input type=hidden name=giftRetailer value="From Proper to Rocker">
<input type=hidden name=RefSource value="FROMPROP2405">
<div id="askQuestion" class="biggerText">
<?php
echo '<a href="' . zen_href_link(FILENAME_ASK_A_QUESTION, 'products_id=' . $_GET['products_id']) . '">' .
zen_image_button(BUTTON_IMAGE_ASK_A_QUESTION, BUTTON_ASK_A_QUESTION_ALT) . '</a>'; ?>
</div>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e03525a3a1f17eb"></script>
</div>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<!--eof Add to Cart Box-->
<!--bof Product details list -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
<?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />
<?php
}
?>
<!--eof Product details list -->
<!--bof Attributes Module -->
<?php
if ($pr_attr->fields['total'] > 0) {
?>
<?php
/**
* display the product atributes
*/
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
<?php
}
?>
<!--eof Attributes Module -->
<br class="clearBoth">
<!--bof Quantity Discounts table -->
<?php
if ($products_discount_type != 0) { ?>
<?php
/**
* display the products quantity discount
*/
require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); ?>
<?php
}
?>
<!--eof Quantity Discounts table -->
<!--bof Additional Product Images -->
<?php
/**
* display the products additional images
*/
require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?>
<!--eof Additional Product Images -->
<br class="clearBoth">
<!--bof Prev/Next bottom position -->
<?php if (PRODUCT_INFO_PREVIOUS_NEXT == 2 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
<?php
/**
* display the product previous/next helper
*/
require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
<?php } ?>
<!--eof Prev/Next bottom position -->
<hr id="product-divider" />
<!--bof Tell a Friend button -->
<?php
if ($flag_show_product_info_tell_a_friend == 1) { ?>
<div id="productTellFriendLink" class="buttonRow forward"><?php echo ($flag_show_product_info_tell_a_friend == 1 ? '<a href="' . zen_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $_GET['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_TELLAFRIEND, BUTTON_TELLAFRIEND_ALT) . '</a>' : ''); ?></div>
<?php
}
?>
<!--eof Tell a Friend button -->
<!--bof Reviews button and count-->
<?php
if ($flag_show_product_info_reviews == 1) {
// if more than 0 reviews, then show reviews button; otherwise, show the "write review" button
if ($reviews->fields['count'] > 0 ) { ?>
<div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) . '</a>'; ?></div>
<br class="clearBoth" />
<p class="reviewCount"><?php echo ($flag_show_product_info_reviews_count == 1 ? TEXT_CURRENT_REVIEWS . ' ' . $reviews->fields['count'] : ''); ?></p>
<?php } else { ?>
<div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div>
<br class="clearBoth" />
<?php
}
}
?>
<!--eof Reviews button and count -->
<!--bof Product URL -->
<?php
if (zen_not_null($products_url)) {
if ($flag_show_product_info_url == 1) {
?>
<p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php
} // $flag_show_product_info_url
}
?>
<!--eof Product URL -->
<!--bof also purchased products module-->
<?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?>
<!--eof also purchased products module-->
<!--bof Form close-->
</form>
<!--bof Form close-->
<?php // BEGIN CEON BACK IN STOCK NOTIFICATIONS 2 of 2
if (isset($back_in_stock_notification_build_form) && $back_in_stock_notification_build_form) {
// Build the notification request form
/**
* Load the template class
*/
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.CeonXHTMLHiTemplate.php');
// Load in and extract the template parts for Back In Stock Notification functionality
$bisn_template_filename = $template->get_template_dir('inc.html.back_in_stock_notifications.html',
DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/' .
'inc.html.back_in_stock_notifications.html';
$bisn_template = new CeonXHTMLHiTemplate($bisn_template_filename);
$bisn_template_parts = $bisn_template->extractTemplateParts();
$back_in_stock_notification_form = new CeonXHTMLHiTemplate;
// Load in the source for the form
$back_in_stock_notification_form->setXHTMLSource(
$bisn_template_parts['PRODUCT_INFO_BACK_IN_STOCK_NOTIFICATION_FORM']);
// Add the form action, titles, labels and button
$form_start_tag = zen_draw_form('back_in_stock_notification',
zen_href_link(FILENAME_BACK_IN_STOCK_NOTIFICATION_SUBSCRIBE, zen_get_all_get_params(),
'NONSSL'), 'POST');
$back_in_stock_notification_form->setVariable('back_in_stock_notification_form_start_tag',
$form_start_tag);
$product_back_in_stock_notification_form_title = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_TITLE;
$back_in_stock_notification_form->setVariable('title',
$product_back_in_stock_notification_form_title);
$name_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_NAME;
$email_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_EMAIL;
$email_confirmation_label = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_ENTRY_CONFIRM_EMAIL;
$back_in_stock_notification_form->setVariable('name_label', $name_label);
$back_in_stock_notification_form->setVariable('email_label', $email_label);
$back_in_stock_notification_form->setVariable('email_confirmation_label',
$email_confirmation_label);
$submit_button = zen_image_submit(BUTTON_IMAGE_NOTIFY_ME, BUTTON_NOTIFY_ME_ALT,
'name="notify_me"');
$back_in_stock_notification_form->setVariable('submit_button', $submit_button);
// Add in the introductory text
$intro_text = sprintf(BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_INTRO,
htmlentities($products_name, ENT_COMPAT, CHARSET));
$notice_text = BACK_IN_STOCK_NOTIFICATION_TEXT_FORM_NOTICE;
$back_in_stock_notification_form->setVariable('intro', $intro_text);
$back_in_stock_notification_form->setVariable('notice', $notice_text);
// Add the customer's details to the form (empty unless logged in)
$back_in_stock_notification_form->setVariable('name',
$back_in_stock_notification_form_customer_name);
$back_in_stock_notification_form->setVariable('email',
$back_in_stock_notification_form_customer_email);
$back_in_stock_notification_form->setVariable('cofnospam',
$back_in_stock_notification_form_customer_email_confirmation);
print $back_in_stock_notification_form->getXHTMLSource();
}
// END CEON BACK IN STOCK NOTIFICATIONS 2 of 2 ?>
</div>
-
Re: creinold Pinterest Button Addon
I loaded your tpl_product_info_dispay.php on my site at the pinit button works perfect. So that file is good. Can I see your meta_tags.php file and your jscript_main.php file?
Something not loading right.
-
1 Attachment(s)
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
I loaded your tpl_product_info_dispay.php on my site at the pinit button works perfect. So that file is good. Can I see your meta_tags.php file and your jscript_main.php file?
Something not loading right.
That's strange. I have attached them for you.
-
Re: creinold Pinterest Button Addon
You have an error in your jscript file....
When you merged my pin it jscript file. You accidentally overwritten the ending tag for the jscript above it.
On line 58 (right above my pinit jscript code) add this:
that should fix it.
-
Re: creinold Pinterest Button Addon
also I notice that you use addThis sharbar, I haven't tried this but this may work also. (You'll still need to use my meta_tags.php code.)
I am not positive if addThis supports the description code I have for pinit but worth a try. If you try it. Let me know how it works. Just wrote it up. =)
change your add this code to:
Code:
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
<a class="addthis_button_pinterest"
pi:pinit:url="<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>"
pi:pinit:media="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>"
pi:pinit:description="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>"
pi:pinit:layout="horizontal">
</a>
</div>
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
You have an error in your jscript file....
When you merged my pin it jscript file. You accidentally overwritten the ending tag for the jscript above it.
On line 58 (right above my pinit jscript code) add this:
that should fix it.
I am not seeing any changes on my site when I add that.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
also I notice that you use addThis sharbar, I haven't tried this but this may work also. (You'll still need to use my meta_tags.php code.)
I am not positive if addThis supports the description code I have for pinit but worth a try. If you try it. Let me know how it works. Just wrote it up. =)
change your add this code to:
Code:
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
<a class="addthis_button_pinterest"
pi:pinit:url="<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>"
pi:pinit:media="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>"
pi:pinit:description="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>"
pi:pinit:layout="horizontal">
</a>
</div>
Just added this code to it and I got 2 pinit buttons up now
-
Re: creinold Pinterest Button Addon
I uploaded your jscript file to my test site. I get the same issue. When I added the closing tag for the popup image above it. It works.
Here my code: try it again and make sure it gets uploaded correctly and to the right folder... /includes/modules/pages/product_info/
Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: jscript_main.php 5444 2006-12-29 06:45:56Z drbyte $
//
?>
<script language="javascript" type="text/javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
function popupWindowPrice(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<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>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=123886947641592";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
I uploaded your jscript file to my test site. I get the same issue. When I added the closing tag for the popup image above it. It works.
Here my code: try it again and make sure it gets uploaded correctly and to the right folder... /includes/modules/pages/product_info/
Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: jscript_main.php 5444 2006-12-29 06:45:56Z drbyte $
//
?>
<script language="javascript" type="text/javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
function popupWindowPrice(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<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>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=123886947641592";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Wait a minute..lol Is this what it's supposed to look like? http://frompropertorocker.com/every-...ce-p-3981.html
-
Re: creinold Pinterest Button Addon
Must be... When I fixed that one jscript closing tag in the jscript file. Everything work for me on my test site.
So some other mod is messing with your jscript files causing it.
To use that add this add on. You may have to remove the codes from jscript file.
also see an error in my addThis code
Change this line:
Code:
pi:pinit:description="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>"
to:
Code:
pi:pinit:description="<?php echo stripslashes($products_description); ?>"
-
Re: creinold Pinterest Button Addon
If that don't work. Just remove that line. Like I said... I am not sure if addThis supports the description line...
-
Re: creinold Pinterest Button Addon
I am starting to wonder if the HTML codes you use to style your description is messing it up. Because it is trying to render them in the pinit description. Hmmm...
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
I am starting to wonder if the HTML codes you use to style your description is messing it up. Because it is trying to render them in the pinit description. Hmmm...
Can you change one of your products descriptions to be just basic text description no html style and test it. Ie: No font tags, no order list / unorder list... etc/// Just text and that's it....
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Can you change one of your products descriptions to be just basic text description no html style and test it. Ie: No font tags, no order list / unorder list... etc/// Just text and that's it....
Sure! Let me do that real quick.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Can you change one of your products descriptions to be just basic text description no html style and test it. Ie: No font tags, no order list / unorder list... etc/// Just text and that's it....
http://frompropertorocker.com/every-...ce-p-3981.html This is where I changed the text.
-
Re: creinold Pinterest Button Addon
Okay the addThis server don't like the zen-cart product url code for some reason. I got to research why. Should just echo the url for the product. I wonder if is an SEO add on that causes the problem. What SEO add on you are using?
it's echo your URL to your product page as: http://frompropertorocker.com/product_info
instead of: http://frompropertorocker.com/every-...ce-p-3981.html
The media tag is working good. Not sure why it doesn't show up in the popup when I press the pintrest button. the url to the image is: http://frompropertorocker.com/images...-piece_MED.jpg which shows it loaded correctly but image not showing up in my pop-up? Weird? Must be something with addThis... Another research item.
I figured out a the description tag.
Code:
<?php echo stripslashes(strip_tags($products_description)); ?>
You can try that on the addThis thingy also.
That will strip the HTML char from the description. I will add that to my next pinterest update.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Okay the addThis server don't like the zen-cart product url code for some reason. I got to research why. Should just echo the url for the product. I wonder if is an SEO add on that causes the problem. What SEO add on you are using?
it's echo your URL to your product page as:
http://frompropertorocker.com/product_info
instead of:
http://frompropertorocker.com/every-...ce-p-3981.html
The media tag is working good. Not sure why it doesn't show up in the popup when I press the pintrest button. the url to the image is:
http://frompropertorocker.com/images...-piece_MED.jpg which shows it loaded correctly but image not showing up in my pop-up? Weird? Must be something with addThis... Another research item.
I figured out a the description tag.
Code:
<?php echo stripslashes(strip_tags($products_description)); ?>
You can try that on the addThis thingy also.
That will strip the HTML char from the description. I will add that to my next pinterest update.
I have Ultimate SEO URLs installed. I can turn it off in the admin to see if that works.
-
Re: creinold Pinterest Button Addon
I just noticed that there is Pin It text under my photo and if you click that the description comes up. Not sure where that came from.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
nolsowski
I just noticed that there is Pin It text under my photo and if you click that the description comes up. Not sure where that came from.
Okay now I noticed when I went the description page and added my font size and font choice now I get the duplicate description back up.
-
Re: creinold Pinterest Button Addon
Sorry my laptop battery died. Was at bookstore. I'll get back on later tonight. :(
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Sorry my laptop battery died. Was at bookstore. I'll get back on later tonight. :(
Oh that's fine. Thank you for all your help so far! I really appreciate it. :D
-
Re: creinold Pinterest Button Addon
No problem. Hard to troubleshooting on my phone inet. LOL
Have you true turning off ultimate seo. And check to see what happens?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
No problem. Hard to troubleshooting on my phone inet. LOL
Have you true turning off ultimate seo. And check to see what happens?
LOL. Understandable.
Yes I did turn it off but it doesn't look like it helped any.
-
Re: creinold Pinterest Button Addon
and did you use the new:
Code:
<?php echo stripslashes(strip_tags($products_description)); ?>
for the description?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
and did you use the new:
Code:
<?php echo stripslashes(strip_tags($products_description)); ?>
for the description?
Yep I have it like this: pi:pinit:description="<?php echo stripslashes(strip_tags($products_description)); ?>" is that the correct way?
-
Re: creinold Pinterest Button Addon
I mean like this lol
PHP Code:
pi:pinit:description="<?php echo stripslashes(strip_tags($products_description)); ?>"
-
Re: creinold Pinterest Button Addon
Yeah that is correct.But looks like you added my pinterest codes back in to tpl_product_info_display.php did you also change it there?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Yeah that is correct.But looks like you added my pinterest codes back in to tpl_product_info_display.php did you also change it there?
I just changed that code in the tpl_product_info_display.php. Where was the other place I was supposed to put it in?
-
Re: creinold Pinterest Button Addon
I think I am confusing the both of us. lol I have the changed version of the addthis code you gave me and this code
PHP Code:
!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
in my tpl_product_info_display.php am I supposed to have them both in my tpl_product_info_display.php?
-
Re: creinold Pinterest Button Addon
Change this:
Code:
!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
To this:
Code:
!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Whew that was hard to do on my phone... LOL
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Change this:
Code:
!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
To this:
Code:
!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div><!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Whew that was hard to do on my phone... LOL
LOL Thanks! It took off the extra description and changed it to the text Pin It under my image. If you click on that the description does show up in the pop window. But if you click on the Pin It button next to my addthis then it doesn't.
-
Re: creinold Pinterest Button Addon
addThis code: Was something I created real fast. I never tested it. You were my guinea pic... ;) LOL I need to play with it later. I don't use addThis on my site. You can remove it till I figure it out better...
to remove, delete:
HTML Code:
<a class="addthis_button_pinterest"
pi:pinit:url="<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>"
pi:pinit:media="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>"
pi:pinit:description="<?php echo stripslashes(strip_tags($products_description)); ?>"
pi:pinit:layout="horizontal">
my pinterest codes:
You need to put the javascript_main.php codes back in too... ;)
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
addThis code: Was something I created real fast. I never tested it. You were my guinea pic... ;) LOL I need to play with it later. I don't use addThis on my site. You can remove it till I figure it out better...
to remove, delete:
HTML Code:
<a class="addthis_button_pinterest"
pi:pinit:url="<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>"
pi:pinit:media="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>"
pi:pinit:description="<?php echo stripslashes(strip_tags($products_description)); ?>"
pi:pinit:layout="horizontal">
my pinterest codes:
You need to put the javascript_main.php codes back in too... ;)
Thanks again for all your help! :D
-
Re: creinold Pinterest Button Addon
I think i know what causing the image not to show... are you using some kind of image manager?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
I think i know what causing the image not to show... are you using some kind of image manager?
Yeah Image Handler 3.
-
Re: creinold Pinterest Button Addon
I will have to look into how it pulls the image file. The url to the image my sql query pulls is the standard zen cart image.
ie the url would look like this: http://frompropertorocker.com/images...etters_MED.jpg
image handler url looks more like: http://frompropertorocker.com/bmz_ca...ge.250x184.jpg
Ill have download image handler later and look into how it generates it image codes.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Sounds good! Thanks again!
-
Re: creinold Pinterest Button Addon
Also please make sure when you upload images they don't have any spaces in the name IE:
Blue Block Letters.jpg should be Blue_Block_Letters.jpg or similar....
It will mess up url coding...
-
Re: creinold Pinterest Button Addon
You welcome... You are almost there just got to get your images working now. =)
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Also please make sure when you upload images they don't have any spaces in the name IE:
Blue Block Letters.jpg should be Blue_Block_Letters.jpg or similar....
It will mess up url coding...
I will fix those right away. :) Thanks for the heads up.
-
Re: creinold Pinterest Button Addon
Okay let see if this fixes the image issue:
change:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
to:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Okay let see if this fixes the image issue:
change:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
to:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Nope :(
-
Re: creinold Pinterest Button Addon
Okay. I'll figure it out. Just have to figure out how image handler 3 pulls from the bmz cache.
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Okay. I'll figure it out. Just have to figure out how image handler 3 pulls from the bmz cache.
Sounds good!
-
Re: creinold Pinterest Button Addon
still working on the fix... sorry busy day, but I haven't forgot. =)
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
still working on the fix... sorry busy day, but I haven't forgot. =)
Not a problem! Take your time. :)
-
Re: creinold Pinterest Button Addon
try this:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_large; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
try this:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_large; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Thank you but it still didn't work.
-
Re: creinold Pinterest Button Addon
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Grrrr. ;)
LOL! I bet you are pulling your hair out right about now.
-
Re: creinold Pinterest Button Addon
Okay lets try this... add this to the bottom of jscript_main.php
Code:
<?php
if (isset($_GET['products_id'])) { // use products_image if products_id exists
$pinterest_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
$pt_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $pinterest_image->fields['products_image'];
}
?>
Then change ths in tpl_product_info_display.php:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
to this:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo $pt_image; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Okay lets try this... add this to the bottom of jscript_main.php
Code:
<?php
if (isset($_GET['products_id'])) { // use products_image if products_id exists
$pinterest_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
$pt_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $pinterest_image->fields['products_image'];
}
?>
Then change ths in tpl_product_info_display.php:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
to this:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo $pt_image; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
The image works now but my pin it button is gone and so is the description.
-
Re: creinold Pinterest Button Addon
opps I forgot to strip the html from the description... here the correct code:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
opps I forgot to strip the html from the description... here the correct code:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Now the image doesn't work. lol
-
Re: creinold Pinterest Button Addon
Okay try this now:
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo $pt_image; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
I also don't see this in your codes/ Make sure it's added to the jscript_main.php
Code:
<?php
if (isset($_GET['products_id'])) { // use products_image if products_id exists
$pinterest_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
$pt_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $pinterest_image->fields['products_image'];
}
?>
-
Re: creinold Pinterest Button Addon
I think something is wrong with the pintrest servers. Nothing loading even on my site were it works... Hmmm
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
I think something is wrong with the pintrest servers. Nothing loading even on my site were it works... Hmmm
I changed the code above and I made sure the code was in my jscript_main.php. I don't know if the pintrest servers are still down but I don't see my description and image yet. I am going to be gone for the day but will check back once I am home. Thanks again!
-
Re: creinold Pinterest Button Addon
Okay just got home and noticed that the image and description doesn't show up at all. Not sure if pintrest servers are still down but that's where I am at.
-
Re: creinold Pinterest Button Addon
Just found out Pinterest update the codes. So now my codes will have to be update also. So tomorrow I will update to the newest codes. Geez you think they keep some kind of backward compatibility at least...
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
creinold
Just found out Pinterest update the codes. So now my codes will have to be update also. So tomorrow I will update to the newest codes. Geez you think they keep some kind of backward compatibility at least...
Yeah you would think they would.
-
Re: creinold Pinterest Button Addon
I added your code to our shopping cart and although it is working somewhat I have a few questions. The "Pin It" words are showing up on each product but not the PinIt image like on your page. Also, the link on the URL stops after "/index.php?main_page=product_info&" so it cuts off the end of my URL and then when posted on pinterest.com it does not have the correct link.
http://www.fishid.com/nwp/index.php?...&products_id=1
Thanks, Eric
-
Re: creinold Pinterest Button Addon
Pinterest release some new codes that break this mod. I have an update but newer codes also broken. The count bubble is broken. I have a trouble ticket out with Pinterest developers.
-
Re: creinold Pinterest Button Addon
Read through this entire thread. First off, thank you very much for your patience and efforts on this plugin.
Secondly, did you ever figure out why the images don't load?
Thanks
-
Re: creinold Pinterest Button Addon
It doesn't pull my images or load my description either :blink:
Im running v1.5.0
-
Re: creinold Pinterest Button Addon
Not working on our systems...
Pinit mod... maybe time to binit... and start again. :D
-
Re: creinold Pinterest Button Addon
I have tried and tried but have been unable to get this mod working properly. But thankfully, Numinex has come thru and there mod works great. Can be downloaded here:
https://www.numinix.com/zen-cart-mod...d2920d83b40eb8
-
Re: creinold Pinterest Button Addon
I figured this out... was pulling the image from the wrong directory... added /images/ to it...
Code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) --><div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . '/images/' . $products_image; ?>&description=<?php echo stripslashes(strip_tags($products_description)); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
-
Re: creinold Pinterest Button Addon
further improved in case a product had an overly long description:
Code:
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . '/images/' . $products_image; ?>&description=<?php echo stripslashes(strip_tags(substr($products_description,0,500))); ?>" class="pin-it-button" count-layout="vertical">Pin It</a></div>
-
Re: creinold Pinterest Button Addon
its too complicated, and will change some former setting also slow down the speed open site. just insert this code in the tpl_product_info_display.php
<!--Bof creinold Pinterest .) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
<!--eof creinold Pinterest .) -->
then it will run good. just like this: http://www.mart07.com/europe-style-l...t-p-13244.html
-
Re: creinold Pinterest Button Addon
Got this mod installed and working ... but it's adding two "Pin It" buttons to some products. I thought it might have something to do with HTML in the item description. But all our products have that and it only adds the additional button on certain items.
We are using 1.3.9h.
Any help would be appreciated.
Single "Pin It" Button:
http://curlygirlstore.com/index.php?...roducts_id=298
Two "Pin It" Buttons:
http://curlygirlstore.com/index.php?...roducts_id=299
-
Re: creinold Pinterest Button Addon
I fixed this! I went in and acted like I was going to edit the item, didn't make any changes and the previewed/saved it ... and the additional "Pin It" button disappeared. Strange.
-
Re: creinold Pinterest Button Addon
Hi,
I tried this mod and the pin it button appears, but it when clicking the pin it button it just shows an empty box and the URL in the pinterest.com pop up is just the home page directory...no product image :dontgetit
Tried the Numinix mod, but got as far as trying to install the SQL patch that throws the error:
ERROR: Cannot execute because table admin_pages does not exits. CHECK PREFIXES!
I am using 1.3.8, I'd really love to have a working pin it button...
edvon
-
Re: creinold Pinterest Button Addon
.. tried again, ignored the SQL patch error, pin it button works now with the Numinix mod :smile:
-
Re: creinold Pinterest Button Addon
This only allows sharing of the first main image instead of allowing the user to select any of the additional images?
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
mart07
its too complicated, and will change some former setting also slow down the speed open site. just insert this code in the tpl_product_info_display.php
<!--Bof creinold Pinterest .) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
<!--eof creinold Pinterest .) -->
then it will run good. just like this:
http://www.mart07.com/europe-style-l...t-p-13244.html
I've tried to install it in several places. It will not show. Do you have any suggestions?
-
Re: creinold Pinterest Button Addon
I installed the pin in button (thank you for this!) it goes to Pinterest just fine.
But next to the button shows this on each product page:
" class="pin-it-button" count-layout="horizontal">Pin It
I am not as smart as I want to be and was wondering how to get rid of these words. I've gone thru this forum to see if anyone else gets part of this code visible but looks like I'm the only one :(
This, I assume, comes from the tpl_product_info_display.php file...
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) --> <?php
}
?>
-
Re: creinold Pinterest Button Addon
I took out the visible lines from the code and although it solved the issue on some products, other products multiple pin button show up (and the description disappears). :dontgetit
-
Re: creinold Pinterest Button Addon
Hey Creinold!
I just wanted to thank you for your code for using Pinterest with Image Handler 3! I am not using your mod, but I modified the Zen Bookmarking Widget and it allowed me to see the image in Pinterest.
Thanks a bunch!
Link to working page: http://store.nicholaslodge.com/mc235-p-5663.html
-
Re: creinold Pinterest Button Addon
I have spent the whole day trying to get this mod to work and I'm sure it's something simple.
The Pinterest window pops up, but there is no image or description and the "Pin it" button is greyed out.
I used WinMerge on the tpl_product_info_display.php files and the only difference between the mod and mine was the little bit of code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
I replaced my jscript_main.php and meta_tags.php with the ones provided.
I am using the Ashley Pink template from Picaflor Azul.
Any advice will be appreciated.
URL: www.twiddletails.com/store
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
twiddletails
I have spent the whole day trying to get this mod to work and I'm sure it's something simple.
The Pinterest window pops up, but there is no image or description and the "Pin it" button is greyed out.
I used WinMerge on the tpl_product_info_display.php files and the only difference between the mod and mine was the little bit of code:
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<div id="pinterest"><a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a></div>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
I replaced my jscript_main.php and meta_tags.php with the ones provided.
I am using the Ashley Pink template from Picaflor Azul.
Any advice will be appreciated.
URL:
www.twiddletails.com/store
I am having this same problem. Not sure what I am missing. I believe I have installed everything correctly but no luck. I get a blank pinterest page pop up wit no image and no description or pricing info listed. Any help would be great for us. Really wanna get this going along. Thanks!
-
Re: creinold Pinterest Button Addon
Quote:
Originally Posted by
only1platinum
I am having this same problem. Not sure what I am missing. I believe I have installed everything correctly but no luck. I get a blank pinterest page pop up wit no image and no description or pricing info listed. Any help would be great for us. Really wanna get this going along. Thanks!
I ended up uninstalling this one (couldn't get it to work right) and I installed this one by Numinix. Here is the direct link: https://www.numinix.com/zen-cart-mod...-pin-it-button
I haven't had any problems from the Numinix one. Hope this helps :)
-
Re: creinold Pinterest Button Addon
Hello i install creinold Pinterest works fine but not on some characters like á ã. exemple in Portugal we use câmara (its camera) and if the product have one of this characters i cant do the pint it.
I think they are utf-8 characters. is possible to place a line of php code to help convert these characters?
can someone help
Tanks
-
Re: creinold Pinterest Button Addon
First off, let me say thank you for this plug-in, it is a tremendous help to zen cart website owners.
I'm having the following problem, however. When users are pinning something from my site, the link being generated by Pinterest is always going to
/index.php?main_page=product_info and not to the individual page they are pinning from. Same thing happens when I personally try and pin something from my site using your addon. Any idea why this is happening?
Thanks again for the addon
-
Re: creinold Pinterest Button Addon
Every is working but the number of times pinned? I am adding the follwing to:
\includes\templates\My_Tempelate\templates\tpl_product_info_display.php
<!--Bof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
<a href="http://pinterest.com/pin/create/button/?url=<?php echo zen_href_link(FILENAME_PRODUCT_INFO); ?>&media=<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo $products_name; ?> <?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?>" class="pin-it-button" count-layout="horizontal">Pin It</a>
<!--eof creinold Pinterest Modifications, (You can move this anywhere you like the Pin it Button to show up on Product Info page.) -->
Can't figure this one out!
-
Re: creinold Pinterest Button Addon
Has anyone used this with the facebook addon?
I would like to have both next to each other on the product page
Any help would be greatly apprecated.
PS I am a real new zenner ;)
my store is www.thecoinopshopinc.com
-
2 Attachment(s)
Re: creinold Pinterest Button Addon
Where I have Products Price (Net): and Products MSRP: added, I am getting the "<span class=" at the end of Product name?
Attachment 12247
Also where the price is set by attributes, I am getting <br>
Attachment 12248
Any ideas?
-
Re: creinold Pinterest Button Addon
does anyone know where "zen_get_products_display_price" is defined ?
When I take it out of the code <span class= and <br /> go away!
But the price disappears also.
-
Re: creinold Pinterest Button Addon
I suppose no one is supporting this add-on anymore??
-
Re: creinold Pinterest Button Addon
Sorry I quit using zen cart awhile back ago :(