Characteristics/Variants Not Applied in Cart

  • Posts: 242
  • Thank you received: 0
11 years 5 months ago #6161

Good Morning,

I'm sure this was working correctly before 1.4.4, but after the update, if I select a Variant, the price on the product detail page is updated, but when I click Add to Cart, the default Product/Characteristic/Price is added, not the selected Variant. Also, after the product is added to the cart, the product page reverts to the default Characteristic setting, but maybe that is normal.

I also have the problem reported in another thread where the Characteristic does not properly get added to the Product name when the Characteristic/Variant is changed on the Product page. The page initially loads with the default Characteristic added to the name but it does not change. This issue was present before the upgrade to 1.4.4 and I suspect it is related to the template I'm using as your demo site does not have this problem.

Regards,
Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 5 months ago #6165

Hi,

There is indeed a problem in the new version on characteristics selection.

You need to replace the code:

					$this->row =& $variant;
					$this->setLayout('quantity');
by:
					$this->row =& $variant;
					$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1'.$form.'); } else { return false; }';
					$this->setLayout('quantity');
in the file show of the view product via the menu Display->Views to fix the problem.

We'll release a new version with the fix asap

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

  • Posts: 242
  • Thank you received: 0
11 years 5 months ago #6175

Thanks - That works.

Since I still have the problem of Characteristics/Variants, when changed, not being appended to the Product Name on the Product page, would it be possible to NOT have ANY Characteristic appended to the name there, but still be included with the Product name in the Cart, because that part is working OK. That would be better than the way it is working now, at least with the template I'm using.

I tried turning off the option in Configuration/Display, but that turns if off for both the Product Page and Cart.

Regards,
Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 5 months ago #6176

You can always edit the file administrator/components/com_hikashop/classes.php and change the code below:
$variant->$field.=' '.$val->characteristic_value;
to:
if(!(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show')){
$variant->$field.=' '.$val->characteristic_value;
}

But please note that this will be removed if you update hikashop.

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

  • Posts: 242
  • Thank you received: 0
11 years 5 months ago #6177

Thanks Again!

I guess I should know by now not to ask if something is possible, as just about anything is possible with this component it seems, provided you know which file to alter and how to alter it.

Ed

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

  • Posts: 242
  • Thank you received: 0
11 years 5 months ago #6178

Would that be file administrator/components/com_hikashop/classes/product.php? I don't find file administrator/components/com_hikashop/classes.php

Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 5 months ago #6179

Yes, of course. I should check a bit what I'm writing :p

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

  • Posts: 242
  • Thank you received: 0
11 years 4 months ago #8410

nicolas wrote:

You can always edit the file administrator/components/com_hikashop/classes.php and change the code below:
$variant->$field.=' '.$val->characteristic_value;
to:
if(!(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show')){
$variant->$field.=' '.$val->characteristic_value;
}

But please note that this will be removed if you update hikashop.


The line you said to replace does not exist in the same form in the latest release. The closest I can find is:
$variant->$field.=$separator.$val->characteristic_value;

Should I replace that line with the code supplied above or does it need to be modified?

Thanks,
Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 4 months ago #8413

You can use this now:

if(!(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show')){
$variant->$field.=$separator.$val->characteristic_value;
}

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

  • Posts: 78
  • Thank you received: 0
11 years 3 months ago #9678

Running starter 1.4.6 we appear to be having this same issue with the base product/base price always going into cart regardless of variant selected.

Upgraded to 1.4.7 and still occurs.

It seems to be working OK on demo site?? Any thoughts?

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 3 months ago #9695

There was such problem in previous versions indeed. With 1.4.7, it should be good though.
Could you give a link to the product where you have the problem so that we can check it ?

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

  • Posts: 78
  • Thank you received: 0
11 years 3 months ago #9786

OK, got it sorted. I copied our product/show to the demo site and it performed the same. Once I knew this was the file responsible I went through our 1.4.3 and found our customisations, uploaded the 1.4.7 file and re-entered our customisations and away we go.

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

  • Posts: 242
  • Thank you received: 0
11 years 2 months ago #12759

hdracing wrote:

nicolas wrote:

You can always edit the file administrator/components/com_hikashop/classes.php and change the code below:
$variant->$field.=' '.$val->characteristic_value;
to:
if(!(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show')){
$variant->$field.=' '.$val->characteristic_value;
}

But please note that this will be removed if you update hikashop.


The line you said to replace does not exist in the same form in the latest release. The closest I can find is:
$variant->$field.=$separator.$val->characteristic_value;

Should I replace that line with the code supplied above or does it need to be modified?

Thanks,
Ed

Sorry to bring this up again, but after updating to 1.4.8 this morning, I again need to modify administrator/components/com_hikashop/classes/product.php to get around the problem with my template not updating variant labels properly. Could you please point me to the code that needs to be changed as the previous code does not exist in the same form now.

Thanks,
Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 2 months ago #12781

It's the same as 1 month ago:
$variant->$field.=$separator.$val->characteristic_value;

to:

if(!(JRequest::getVar('ctrl')=='product'&&JRequest::getVar('task')=='show')){
$variant->$field.=$separator.$val->characteristic_value;
}

We did not change it since then.

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

  • Posts: 242
  • Thank you received: 0
11 years 2 months ago #12785

Thanks Nicolas,

I searched for that line but didn't find it so thought it had changed again. Must have had a typo in my search request.

Sorry for wasting your time on this.
Ed

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

  • Posts: 75835
  • Thank you received: 11830
  • MODERATOR
11 years 2 months ago #12786

No problem.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum