Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Ask a Question button near the add to cart button

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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
  #2  
Old 03-25-2006, 12:49 PM
 
Delw Delw is offline
 

Member
  
Join Date: Aug 2005
Location: Glendale, Az.
Posts: 29
 

Default

I was try to add this mod but run into this problem when trying to do this mod, but on the first step

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

I got this error msg when I did the above.
Quote:
Error
The label for language selected is invalid. Please select another label.

I can guarenttee you its user error on my part, do I have to do something with permissions in order to do this?
__________________
Version 4.7.11
Reply With Quote
  #3  
Old 03-25-2006, 12:53 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

http://forum.x-cart.com/viewtopic.php?t=27245
Reply With Quote
  #4  
Old 03-25-2006, 06:16 PM
 
Delw Delw is offline
 

Member
  
Join Date: Aug 2005
Location: Glendale, Az.
Posts: 29
 

Default

Quote:
Originally Posted by TelaFirma
http://forum.x-cart.com/viewtopic.php?t=27245

Is this because of version number?

or do I need to do the one you gave me in the link first?


Delw
__________________
Version 4.7.11
Reply With Quote
  #5  
Old 03-25-2006, 07:03 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

I posted that link becuase the first post also had some questions about getting it to work. The link that I posted is of a version that I have tried out and seems to work OK.
Reply With Quote
  #6  
Old 03-25-2006, 07:32 PM
 
Delw Delw is offline
 

Member
  
Join Date: Aug 2005
Location: Glendale, Az.
Posts: 29
 

Default

TelaFirma
Thank you I will try that link out

Delw
__________________
Version 4.7.11
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:02 AM.

   

 
X-Cart forums © 2001-2020