Skip to main content

Subject Line in "Contact us for information" emai

More
14 years 9 months ago #32393 by Jims
Good morning Nicolas.

The email that I get when someone sends a "Contact us for more information" email only contains the variants and not the product name or product code.

Shouldn't the email include the product name and product code?

Thanks

Jim

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32410 by nicolas
Well, before the email contained the product name and we had several users asking to have the variant name instead of the product name so we did that change.
You're the first one asking for the opposite since then :)

You can remove the code:
if($product->product_type=='variant' && empty($product->product_name)){
$product = $class->get((int)$element->product_parent_id);
}

in the file components/com_hikashop/controllers/product.php and that will use the product name instead of the variant name.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32425 by Jims
Thanks, Nicolas,

Actually, what I would like to see there is exactly the same as appears on the product page, productname and variants
See: www.potluckceramics.ca/index.php/catalog.../category_pathway-22

It would also be helpful to see the product code in the message somewhere.

Jim

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32435 by nicolas
Well, you would have to change the code in the file components/com_hikashop/controllers/product.php for all that.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32436 by Jims
I'm not sure my coding skills are up to that, the last time I wrote code it was using the language APL!
But it might be an interesting challenge!!

Thanks

Jim

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32669 by Jims
nicolas wrote:

You can remove the code:
if($product->product_type=='variant' && empty($product->product_name)){
$product = $class->get((int)$element->product_parent_id);
}

in the file components/com_hikashop/controllers/product.php and that will use the product name instead of the variant name.


Sorry, Nicolas. I removed that code from the product.php file, but the subject line still contains the variants not the product name.

I also tried to modify the code to show the line:

About: Product-Name - variants

but I could only get the line to sow the product-ID on the About line.

I find it rather surprising that the message does not contain exactly the same text as is shown in the title of the product page. There is no way, at the moment, to see what page the message was sent from.

The clients really want this, and at the moment I'm stumped.

Jim

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32692 by nicolas
Ah yes, instead of removing the code above,
just change the line:
if($product->product_type=='variant' && empty($product->product_name)){
to:
if(true){

so that it always uses the variant name.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago - 14 years 9 months ago #32699 by Jims
Yes, I see that, Nicolas, but that's not what the clients want to see in the message.

For the message from the page
www.potluckceramics.ca/index.php/catalog...90-yellow-29-cm-wide

They want to see
Subject: A contact request has been made for the product 'Bowl with edge: Yellow - 29 cm wide'
and not just
Subject: A contact request has been made for the product 'Yellow - 29 cm wide'

because there are several products with the Yellow 29 variants.

Also I was able to change the body to show the product-id after About:
See
From Address :
.ca
From Name : jswift
About : 3790

But I would like to know how to show the product-code there instead of the product-id. I cannot see where the function is getting the product information on the page from?

The client wants to be able to identify the page from which the message is sent, but currently that's not possible.

Many thanks

Jim
Last edit: 14 years 9 months ago by Jims.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32739 by nicolas
Then, if you want both, do like that:

$variant = $class->get((int)$element->product_parent_id);
$subject = JText::sprintf('CONTACT_REQUEST_FOR_PRODUCT',$product->product_name.': '.$variant->product_name);


instead of:
if($product->product_type=='variant' && empty($product->product_name)){
$product = $class->get((int)$element->product_parent_id);
}
if(!empty($product)){
$subject = JText::sprintf('CONTACT_REQUEST_FOR_PRODUCT',$product->product_name);
}

The product code of the product will be in $product->product_code and the variant product code will be in $variant->product_code

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago - 14 years 9 months ago #32784 by Jims
Many thanks, Nicolas. that is a big help (along with var_dump) in figuring what was going on. The key was that the product name I wanted is actually the product name of the product_parent, but the variant information is the product_name of the product!!

Just in case others might be interested the code (in product.php) is now:

if(!empty($element->product_id)){

$class = hikashop_get('class.product');
$product = $class->get((int)$element->product_id);
$variant = $class->get((int)$product->product_parent_id);
$subject = JText::sprintf('CONTACT_REQUEST_FOR_PRODUCT',$product->product_code.': '.$variant->product_name.' - '.$product->product_name);

}
This gives the following sample subject line:
Subject: A contact request has been made for the product 'RBT-Y-60: Breakfast Cup - Yellow Bear Tracks'

Thanks very much for the help, Nicolas.

Jim
Last edit: 14 years 9 months ago by Jims.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33607 by Karloz
Hello, i can not make this work, maybe because i have no product variants.

I Allways recieve a message with subejct line "A contact request has been made"

Please how can i add product_code and product_name to the email subject ?

Thank you

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33608 by Karloz
Hello, i can not make this work, maybe because i have no product variants.

I Allways recieve a message with subejct line "A contact request has been made"

Please how can i add product_code and product_name to the email subject ?

Thank you

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33643 by nicolas
The product name is added automatically to the subject of the email, there is nothing to do. Could you give a link to your product page so that we can look at your contact form ?

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33839 by Karloz
Hi, here is the link for product page

new.deltakwadrant.net/index.php?option=c...ry_pathway=0&lang=en

I think i have the subject message just "A contact request has been made" from the beginning of instaling hikashop
I already asked for extras subject line in another thread, because i didnt know the product name should be added automatically.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33861 by nicolas
I think I understand the problem.

Please edit the file "show" of the view "product" via the menu Display->Views and change the line:


echo $this->cart->displayButton(JText::_('CONTACT_US_FOR_INFO'),'contact_us',$params,hikashop_completeLink('product&task=contact&cid='.$this->row->product_id),'window.location=\''.hikashop_completeLink('product&task=contact&cid='.$this->row->product_id).'\';return false;');


to:

echo $this->cart->displayButton(JText::_('CONTACT_US_FOR_INFO'),'contact_us',$params,hikashop_completeLink('product&task=contact&cid='.$this->element->product_id),'window.location=\''.hikashop_completeLink('product&task=contact&cid='.$this->element->product_id).'\';return false;');


That should solve the problem.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #33877 by Karloz
Yes it does, thank you very much

Please Log in or Create an account to join the conversation.

Time to create page: 0.267 seconds
Powered by Kunena Forum