Forums / All Other Contributions/Addons / creinold Pinterest Button Addon

creinold Pinterest Button Addon

Results 1 to 20 of 98
10 Mar 2012, 01:00
#1
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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.
10 Mar 2012, 01:06
#2
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

Waiting for review....
10 Mar 2012, 22:26
#3
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Posts:
1,558
Plugin Contributions:
1

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?
11 Mar 2012, 16:11
#4
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

Yeah... Has to do with the Pinterest servers.

Update: Had to resubmit the contribution. Forgot GPL license.... DUH!
11 Mar 2012, 19:23
#5
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

It's added to contribution area.

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_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.
11 Mar 2012, 19:34
#6
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

This add on will also work with older version if Zen-Cart.
14 Mar 2012, 17:39
#7
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

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-egg-yellow-knit-pant-set-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
15 Mar 2012, 03:53
#8
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

can you paste your tpl_product_info_display.php so I can see what's going on?
15 Mar 2012, 12:08
#9
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

creinold:

can you paste your tpl_product_info_display.php so I can see what's going on?


Sure! It's [PHP]<?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>[/PHP]
16 Mar 2012, 17:28
#10
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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.
16 Mar 2012, 17:40
#11
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

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.
16 Mar 2012, 17:52
#12
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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:

//--></script>


that should fix it.
16 Mar 2012, 18:03
#13
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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:

<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> 
16 Mar 2012, 18:05
#14
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

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:

//--></script>


that should fix it.


I am not seeing any changes on my site when I add that.
16 Mar 2012, 18:13
#15
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

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:

<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
16 Mar 2012, 18:15
#16
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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/

<?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>
16 Mar 2012, 18:19
#17
nolsowski avatar

nolsowski

Inactive

Join Date:
Aug 2010
Posts:
324
Plugin Contributions:
0

Re: creinold Pinterest Button Addon

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/

<?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-bunny-needs-a-little-bling-tutu-onepiece-p-3981.html
16 Mar 2012, 18:25
#18
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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:
pi:pinit:description="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>&description=<?php echo stripslashes($products_description); ?>"


to:

pi:pinit:description="<?php echo stripslashes($products_description); ?>"
16 Mar 2012, 18:27
#19
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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...
16 Mar 2012, 18:30
#20
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Posts:
287
Plugin Contributions:
0

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...