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)
-   -   Change subject line in "Ask a question about this product" (https://forum.x-cart.com/showthread.php?t=69017)

anandat 04-11-2014 07:39 PM

Change subject line in "Ask a question about this product"
 
Hello,
when ever some one send query through "Ask a question about this product". we are getting mails like "yoursite.com: Someone asked a question about product"
Actually it should be like "Question regarding PRODUCT NAME(PRODUCT CODE at yoursite.com
This will make more sense.;-)

Can any one tell me how to achieve this ?

totaltec 04-11-2014 11:17 PM

Re: Change subject line in "Ask a question about this product"
 
Look at /common_files/mail/html/ask_question.tpl

And the language variables are:
eml_someone_ask_question
eml_someone_ask_question_at
eml_someone_ask_question_subj

anandat 04-12-2014 07:26 AM

Re: Change subject line in "Ask a question about this product"
 
Hi Mike,
Thanks for the info.
Since I just wanted to change subject line
I edited the label "eml_someone_ask_question_subj" to
Question regarding {{product_name}} (product code: {{productid}}) at {{STOREFRONT}}

But it does't populate the variables & in email I am getting subject line like "mysitename.com: Question regarding {{product_name}} (product code: {{productid}}) at {{STOREFRONT}}

what I am missing out ? :(

totaltec 04-12-2014 07:48 AM

Re: Change subject line in "Ask a question about this product"
 
When you use variables in a language entry, they have to be translated by the template that the language variable is used in. So I can put whatever I want between brackets {{whatever}} but in the actual template where this language variable is called, I need to tell the engine what to do with it.

In common_files/mail/html/ask_question.tpl you can see an example of this in action:
{$lng.eml_someone_ask_question|substitute:"STOREFR ONT":$current_location:"productid":$productid:"pro duct_name":$product}

So in your case you are using a language variable that is called in common_files/mail/html/ask_question_subj.tpl

You need to add the
|substitute:"STOREFRONT":$current_location:"produc tid":$productid:"product_name":$product

into the language variable call in that template.

anandat 04-12-2014 07:41 PM

Re: Change subject line in "Ask a question about this product"
 
Hi Mike,
Thanks a lot. It's working now like a charm :D/
I don't know why x-cart team have not done such a way. We are receiving many inquires via "ask a question" form now it will be very easy to manage the questions as it's more effective & time saver method.

If any one wants to achieve this. just open your \skin\common_files\mail\ask_question_subj.tpl & replace the entire code with
PHP Code:

{config_load file="$skin_config"}{$config.Company.company_name}:{$lng.eml_someone_ask_question_subj|substitute:"STOREFRONT":$current_location:"productid":$productid:"product_name":$product


Now find language label eml_someone_ask_question_subj & replace with this code
PHP Code:

Question about {{product_name}} product code: {{productid}} 



All times are GMT -8. The time now is 01:43 PM.

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