| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
'Add to Cart' Alert Message | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#61
|
|||||||||
|
|||||||||
![]() Quote:
Thanks for pointing this out. I am just not sure of how to get this mod to work with the Ability Template.
__________________
4.7.11 BuckeyeFanApparel.com |
|||||||||
#62
|
|||||||
|
|||||||
![]() It shouldn't have anything todo with the template.
It generally happens when your products have 's in the name. try replacing your cart_alert.tpl with the following (strips out any ' from the product for the alert) {if $main eq "product"} {literal} <script type="text/javascript"> function Cart_Alert_Product_{/literal}{$product.productid}{literal}() { Shadowbox.open({player:"html",content:'<div class="alert_msg"><div class="links"><a href="cart.php"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart.png" />{/literal}{$lng.lbl_cart_alert_view}{literal}</a></div><div class="links"><a href="{/literal}{$stored_navigation_script}{literal}" onclick="Shadowbox.close();return false"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart_put.png" />{/literal}{$lng.lbl_cart_alert_continue}{literal}</a></div><div class="links"><a href="cart.php?mode=checkout"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart_go.png" />{/literal}{$lng.lbl_cart_alert_checkout}{literal}</a></div><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/tick.png" />{/literal}{$lng.lbl_cart_alert_added}{literal}<h2>{/literal}{$product.product|replace:'\'':''}{literal }</h2><p>{/literal}<a href="#" onclick="Shadowbox.close();">{include file="product_thumbnail.tpl" productid=$product.image_id image_y=125 product=$product.product|escape tmbn_url=$product.image_url id="product_thumbnail" type=$product.image_type}</a>{literal}</p><p>{/literal}{$lng.lbl_cart_alert_to_cart}{literal}</p><hr /><h3>{/literal}{$lng.lbl_cart_alert_also}{literal}</h3>{/literal}{if $product_links}{section name=product loop=$product_links max=3}<div class="upsell"><a href="product.php?productid={$product_links[product].productid}">{include file="product_thumbnail.tpl" productid=$product_links[product].productid product=$product_links[product].product tmbn_url=$product_links[product].tmbn_url image_y=75}</a><br />{$product_links[product].product|escape:"html"}</div>{/section}{else}{section name=product loop=$recommends max=3}<div class="upsell"><a href="product.php?productid={$recommends[product].productid}">{include file="product_thumbnail.tpl" productid=$recommends[product].productid product=$recommends[product].product tmbn_url=$recommends[product].tmbn_url image_y=75}</a><br />{$recommends[product].product|escape:"html"}</div>{/section}{/if}{literal}<div class="clearing"></div>',height:420,width:600});} Shadowbox.init(); </script> {/literal} {elseif $main eq "search" || $main eq "products" || $main eq "catalog"} {foreach from=$products item=product name=products} {literal} <script type="text/javascript"> function Cart_Alert_Product_{/literal}{$product.productid}{literal}() { Shadowbox.open({player:"html",content:'<div class="alert_msg"><div class="links"><a href="cart.php"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart.png" />{/literal}{$lng.lbl_cart_alert_view}{literal}</a></div><div class="links"><a href="{/literal}{$stored_navigation_script}{literal}" onclick="Shadowbox.close();return false"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart_put.png" />{/literal}{$lng.lbl_cart_alert_continue}{literal}</a></div><div class="links"><a href="cart.php?mode=checkout"><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/cart_go.png" />{/literal}{$lng.lbl_cart_alert_checkout}{literal}</a></div><img class="icon" src="{/literal}{$SkinDir}{literal}/modules/Cart_Alert/images/tick.png" />{/literal}{$lng.lbl_cart_alert_added}{literal}<h2>{/literal}{$product.product|replace:'\'':''}{literal }</h2><p>{/literal}<a href="#" onclick="Shadowbox.close();"><img src="image.php?id={$product.productid}&type=T" /></a>{literal}</p><p>{/literal}{$lng.lbl_cart_alert_to_cart}{literal}</p><hr /><h3>{/literal}{$lng.lbl_cart_alert_also}{literal}</h3>{/literal}{section name=product loop=$products max=3}<div class="upsell"><a href="product.php?productid={$products[product].productid}">{include file="product_thumbnail.tpl" productid=$products[product].productid product=$products[product].product tmbn_url=$products[product].tmbn_url image_y=75}</a><br />{$products[product].product|escape:"html"}</div>{/section}{literal}<div class="clearing"></div></div>',height:420,width:600});} Shadowbox.init(); </script> {/literal} {/foreach} {/if} |
|||||||
#63
|
|||||||||
|
|||||||||
![]() The change has been made but still does not work.
__________________
4.7.11 BuckeyeFanApparel.com |
|||||||||
#64
|
|||||||
|
|||||||
![]() I'm still seeing the js errors - have you cleared your website's cache?
Also, make sure that the javascript code is on one line (line wrap is fine, but new lines will break it) |
|||||||
#65
|
|||||||||
|
|||||||||
![]() Here is the javascript code
// Widget :: change state to Added ajax.widgets.add2cart.obj.prototype.doAddedState = function() { this.button.addClass('do-add2cart-success'); this._freezeBox(); if (this.savedData.box) this.savedData.box.html(lbl_added); // Added to Cart Alert Start window['Cart_Alert_Product_' + this.productid](); // Added to Cart Alert End return true; }
__________________
4.7.11 BuckeyeFanApparel.com |
|||||||||
#66
|
|||||||
|
|||||||
![]() The js errors have todo with the 'content' part of the Shadowbox.open()
|
|||||||
#67
|
|||||||||
|
|||||||||
![]() This mod has me stumped. Phil or Steve.. You out there?
__________________
4.7.11 BuckeyeFanApparel.com |
|||||||||
#68
|
|||||||||
|
|||||||||
![]() If you have ' or " or ; or & in product names, descriptions or images alt text this will break the code unless you escape them
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#69
|
|||||||||
|
|||||||||
![]() I do not believe I have ' or " or ; or & in product names, descriptions or images alt text but to be safe how do I find out and how do I escape them?
__________________
4.7.11 BuckeyeFanApparel.com |
|||||||||
#70
|
|||||||
|
|||||||
![]() The js code above (#62) that starts with Shadowbox.open needs to be on one line.
The newline char is breaking the string (starts with ') |
|||||||
|
|||
X-Cart forums © 2001-2020
|