Skip to main content

Issue with selecting variant characteristic

More
6 years 5 months ago #317566 by Bobwales
-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.16
-- PHP version -- : 7.3.16
-- Browser(s) name and version -- : Chrome 81.0.4044.92
-- Error-message(debug-mod must be tuned on) -- : Uncaught ReferenceError: hikashopUpdateVariant is not defined
at HTMLSelectElement.onchange (index.php?option=com_hikashop&ctrl=product&task=edit&cid[]=198:1)
at Object.trigger (jquery.min.js?4df11245de4898e60d61002f63eff38c:2)
at Object.a.event.trigger (jquery-migrate.min.js?4df11245de4898e60d61002f63eff38c:2)
at HTMLSelectElement. (jquery.min.js?4df11245de4898e60d61002f63eff38c:2)
at Function.each (jquery.min.js?4df11245de4898e60d61002f63eff38c:2)
at a.fn.init.each (jquery.min.js?4df11245de4898e60d61002f63eff38c:2)
at a.fn.init.trigger (jquery.min.js?4df11245de4898e60d61002f63eff38c:2)
at Chosen.result_select (chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1)
at Chosen.search_results_mouseup (chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1)
at HTMLUListElement. (chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1)
onchange @ index.php?option=com_hikashop&ctrl=product&task=edit&cid[]=198:1
trigger @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
a.event.trigger @ jquery-migrate.min.js?4df11245de4898e60d61002f63eff38c:2
(anonymous) @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
each @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
each @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
trigger @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
Chosen.result_select @ chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1
Chosen.search_results_mouseup @ chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1
(anonymous) @ chosen.jquery.min.js?4df11245de4898e60d61002f63eff38c:1
dispatch @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2
v.handle @ jquery.min.js?4df11245de4898e60d61002f63eff38c:2

Hello Hikashop Team
Hope you are all well and safe. Sorry, but I have a little problem with Variant updating...

When I try to select an alternative characteristic from the existing characteristic options I get a script error, and the characteristic is not changed.

For instance, when I want to change a Colour from the existing colour, "Bracken" to become another created colour "Bracken (waiting for stock)", the change is not saved and the browser reports "Uncaught ReferenceError: hikashopUpdateVariant is not defined..."

This seems to be happening since a recent update to the latest version of Hikashop.
Any help appreciated.
Kind regards, Bob

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

More
6 years 5 months ago #317571 by nicolas
Hi,

Please download again the install package of the latest version of HikaShop on our website and install it on yours.
It will add a patch which should fix that.
The following user(s) said Thank You: Bobwales

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

More
6 years 5 months ago #317582 by Bobwales
Fantastic! Thanks Nicolas for staying up late to answer this. All working well here! Hope you, Team Hika and family are keeping well and managing to find some peace and calm during these crazy times. Thanks again and stay safe.

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

More
6 years 5 months ago - 6 years 5 months ago #317593 by Bobwales
Ah, spoke too soon.
We use the Attach Invoice Plugin, and since the update when I try to download the Invoice I receive an error message:
<<
Code:
The html tag [br] is not known by Html2Pdf. You can create it and push it on the Html2Pdf GitHub project
>>
And the invoice is not downloaded.
Where should I look to solve this?
Last edit: 6 years 5 months ago by Bobwales.

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

More
6 years 5 months ago #317597 by Bobwales
Forget that - a couple of hours and the issue has disappeared, sort of. Perhaps some caching thing...

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

More
6 years 5 months ago #317595 by nicolas
Hi,

I don't think this is linked to the update.
This error means that somewhere in the invoice you have a br tag not written properly.
It's hard to say where though.
What I would recommend is to add the code:
Code:
exit;
before the code:
Code:
$pdfContent[] = ob_get_clean();
in the file plugins/system/attachinvoice/attachinvoice.php and then try again.
That way, you'll get to see the HTML of the invoice before the PDF is generated out of it. Then, you can search for that br tag in the HTML of the invoice in order to better understand where the problem is coming from.
It could be the store address, it could be the name of a product, the address of the customer, the address format, etc.

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

More
6 years 5 months ago - 6 years 5 months ago #317615 by Bobwales
Thanks Nicolas
I think I've found it... some code I was trying, to add a custom product field to invoice.php in ../attachinvoice/attachinvoice
Code:
if ($config->get('show_code')) { echo '<br/>'.$product->order_product_code.' NM Code: ';// add a space and neomouv part number here***

So, easy to fix the <br/>. Just a little stuck on how to add a custom product field (in our case 'nmpartnumber'). Any tips?

I've tried echo $product->order_product_nmpartnumber;
And a number of other methods, with no success.
Last edit: 6 years 5 months ago by Bobwales.

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

More
6 years 5 months ago #317626 by nicolas
Hi,

The custom product field data is not loaded in the invoice.
You could do like that:
Code:
$class = hikashop('class.product'); $data = $class->get($product->product_id); echo $data->nmpartnumber;
This supposes that the "column name" setting of your custom product field is "nmpartnumber".

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

More
6 years 5 months ago - 6 years 5 months ago #317667 by Bobwales
Brilliant - that's helped me a lot! (French colleagues need every little detail on every invoice for their system).
I made only one tiny change, if it helps others:
Code:
$class = hikashop_get('class.product');
Merci beaucoup encore!
Last edit: 6 years 5 months ago by Bobwales.
The following user(s) said Thank You: nicolas

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

More
6 years 5 months ago - 6 years 5 months ago #317727 by Bobwales
Sorry to raise this again, now way off the original topic.
Can I use a similar method to access a custom field of type Item?

Each of our bicycles have a Frame number, which we want to record on each invoice, as well as in the item field, "itmframenumber"

If it helps, this is my first naive attempt in the file attachinvoice/invoice.php
Code:
$data = $class->get($product->product_id) ;//get access to the custom fields for this product via variable $data echo implode('<br />',$this->str_split_unicode(strip_tags($product->order_product_name),70)).'<br />NM Code: '.$data->nmpartnumber.'<br /> Frame Number: '.$data->itmframenumber;// add neomouv part number and the related item field frame number, different on each bike

There is data in the itmframenumber field which shows on the back-end order details.
Last edit: 6 years 5 months ago by Bobwales.

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

More
6 years 5 months ago #317730 by nicolas
Hi,

The custom item field data is directly avaliable in $product.
So you can just do:
echo $product->itmframenumber;
The following user(s) said Thank You: Bobwales

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

More
6 years 5 months ago #317756 by Bobwales
Another question: What's the emoji code for <<feeling like an idiot>>? Thanks a lot Nicolas :)

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

More
6 years 5 months ago #317758 by nicolas
No worries :)

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

Time to create page: 0.242 seconds
Powered by Kunena Forum