X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Ask a Question button near the add to cart button (https://forum.x-cart.com/showthread.php?t=20620)

ShishaPipeUK 03-20-2006 07:22 AM

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.

Delw 03-25-2006 12:49 PM

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?

TelaFirma 03-25-2006 12:53 PM

http://forum.x-cart.com/viewtopic.php?t=27245

Delw 03-25-2006 06:16 PM

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

TelaFirma 03-25-2006 07:03 PM

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.

Delw 03-25-2006 07:32 PM

TelaFirma
Thank you I will try that link out

Delw


All times are GMT -8. The time now is 05:28 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.