Jump to content

[solved]how call a function from one module to other module


Recommended Posts

Hi,

 

I am new to prestashop.

 

In prestashop "Add to Mywishlist" link placed in product detail page itcomes automatically.

 

I need to add this link shopping cart page.

 

 

1. I have added below code in \themes\default\shopping-cart-product-line.tpl ( displaying add to mywishlist link in shopping cart page) - please check attached image .

 

I copy the below code from modules/blockwishlist/blockwishlist-extra.tpl

 

 

<p class="buttons_bottom_block">
<a href="#" id="wishlist_button" onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', $('#idCombination').val(), document.getElementById('quantity_wanted').value); return false;">» {l s='Add to my wishlist' mod='blockwishlist'}</a></p>

 

2. In above code WishlistCart finction is ajax function , how to call this function from \themes\default\shopping-cart-product-line.tpl to blockwishwishlist module fucntion

post-581429-0-54966400-1371275767_thumb.png

Edited by karthick (see edit history)
Link to comment
Share on other sites

Hi,

First, be sure you're referencing product IDs correctly, matching the cart's syntax (so if the id is called some other way there, you much change it from $product.id_product to whatever matches).

 

Then, simpky be sure the wishlist javascript file is running on that page (check if it's embedded in the resources panel of google chrome dev tools for example). Additionall, use chrome's console to track any error that may occur! :)

Link to comment
Share on other sites

×
×
  • Create New...