View Single Post
  #1  
Old 03-20-2006, 07:22 AM
  ShishaPipeUK's Avatar 
ShishaPipeUK ShishaPipeUK is offline
 

Senior Member
  
Join Date: Jul 2005
Location: London, England.
Posts: 118
 

Default Ask a Question button near the add to cart button

Hi, i wanted to make another button that customers can click on to email me a question about the product they where looking at.

You can see an example at: http://www.shisha.co.uk/shopcart/product.php?productid=16383&cat=291&page=1

I first went to my admin, languages, and made a button:
Variable = lbl_ask_question
Description = Ask a Question
Value = Ask Question

I then made a button called ask_question.tpl in shopcart/skin1/buttons/ask_question.tpl
Code:
{include file="buttons/button.tpl" button_title=$lng.lbl_ask_question style=$style}

After that i edited my product.tpl file in shopcart/skin1/customer/main/product.tpl and added:

Code:
{include file="buttons/ask_question.tpl" style="button" href="mailto:question@shishapipe.net?subject=Ask Question" target="_blank"}

Naturally change question@shishapipe.net to your email address

You can see the above code in this section here:
Code:
{if $smarty.get.pconf ne ""} <INPUT type="hidden" name="slot" value="{$smarty.get.slot}"> <INPUT type="hidden" name="addproductid" value="{$product.productid}"> {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`';document.orderform.action='pconf.php';document.orderform.submit()`$rdelim`"} {/if} {if $product.forsale ne "B"} {include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"} {include file="buttons/ask_question.tpl" style="button" href="mailto:question@shishapipe.net?subject=Ask Question" target="_blank"} {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {else} {$lng.txt_pconf_product_is_bundled} {/if} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart} {/if} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product_buttons.tpl"} {/if} </TD> </TR></TABLE> </TD> <TD align="right" valign="top" width="60"> {if $product.taxed_price gt 0 and $product.list_price gt 0 and $product.taxed_price lt $product.list_price}<TABLE border="0" width="60"><TR><TD width="55" height="56" class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align="center" valign="middle"> {math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount} <SPAN id="save_percent">{ $discount }</SPAN>% </TD></TR></TABLE>{/if} </TD> </TR> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> </FORM> </TABLE> {include file="subaccess/subaccessphp.tpl"} {/capture} {include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"} {/if} {include file="customer/main/send_to_friend.tpl" } {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if} {if $active_modules.Product_Options ne '' && $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> check_options(); </SCRIPT> {/if}

So this works fine, but what i wanted to do is in the email subject i wanted something like "Ask Question - and then the Product title of the goods"

So it automatically puts in the subject of the email the product like "10 packs of Flavored handcrafted non tobacco cigarettes #16383"

Also is there a way that the sites email address can be put in the above code instead of writng the email address.
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24
PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART

Shop carts at
http://www.nightscene.co.uk/shop/home.php
http://www.theshisha.net/shopcart/home.php
http://www.system-maintenance.com/maint/home.php
http://www.tabac4u.com
Reply With Quote