Default value for variants

  • Posts: 1119
  • Thank you received: 114
6 years 6 months ago #280140

Hi,

Its not about name of the attribute. You can name it as you need. Data-stock, data-quantity....

Its about having some quantity attribute for every variant. This would allow if condition....and its just 1 line of code in ../types/characteristic.php file.

We have modifies for our own needs but as this is core file we dont want to change it after every update...

Would this add some negative to hikashop? For sure NO.
Would this improve hikashop variant selection and allow people to have more modications? Fore sure YES. ( If you are not willing to redo variants in near future ).


So can hikashop add this?

I have seen many sites who use quantity attribute and could add links here if need it.

Thanks

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
6 years 6 months ago #280158

Hi,

With data-stock it's a good idea yes. It's just that "stock" is not a valid HTML attribute so we can't add "stock".
So what line do you suggest we add in there exactly ?

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

  • Posts: 1119
  • Thank you received: 114
6 years 6 months ago #280204

Hi,

Its your choice Nicolas how you want to call it. You have better knowledge in everyway. If you think "data-stock" is fine then please add it.

Will this be added to next hikashop release or just as new build which we could download asap?


As for us this little improvement will allow to add some js and resolve our issue with waitlist notifications...
Thanks for looking into this.

Have a great day

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

  • Posts: 1119
  • Thank you received: 114
6 years 6 months ago #280205

For characteristics selection method > table just need to add on line 155 inside input:

data-stock=\"".$variant->product_quantity."\"

However for radio button this doesnt work on line 278

It looks like this is in another public function display and you need to call it again in foreach loop i guess. I am not sure how this should be correctly handled so i will wait for replay.

Kind Regards

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
6 years 6 months ago #280253

Hi,

We'll add that to the next version.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
6 years 6 months ago #280256

Hi,

Great to hear it. Thank for looking into this.

Have a great day

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

  • Posts: 1119
  • Thank you received: 114
6 years 5 months ago #280863

Hi,

With hikashop 3.2.1 I see you have added data-stock attribute but it is missing for radio buttons?

Kind Regards

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 5 months ago #280864

Hello,

HikaShop is using the Joomla core to display the dropdown or the radio list.
The API do not allow us to add extra data for the radio items ; there is a variable $attribs but it's global for all elements and the "option.attr" that you can find for "option()" is not processed in radiolist.
CF : github.com/joomla/joomla-cms/blob/stagin...html/select.php#L765

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum