custom field in custom module

  • Posts: 14
  • Thank you received: 2
5 hours 43 minutes ago #366203

-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.2.2
-- PHP version -- : 8.1.28
-- Browser(s) name and version -- : chrome latest, firefox, etc.

Hi guys!

I think I have a simple question: how can I call custom fields from a custom module (made by me, not joomla custom html module)?

For example: I want to display a custom field with an external stock quantity (extstore field name) through my custom module, so that it appears on the product page within the show_default.php file. I want to place it after the 'Add to cart button'.

Inserting it as module id (with regular labs) to show_default.php causes the page to crash due to this->element.

Thanks for your help!

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

  • Posts: 83401
  • Thank you received: 13494
  • MODERATOR
2 hours 10 minutes ago #366207

Hi,

Why display the custom field via a module ?
Can't you create a custom field of the table "item" via the Display>Custom fields menu and use the display options to just have HikaShop display it before the add to cart button for you ?
Why is that not possible ?
Where does this "external stock quantity" comes from ? Why do you want to add it to the product page ? What is its purpose ?
If you can provide more explanation on what you're trying to achieve, we should be able to tell you what to do.

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

  • Posts: 14
  • Thank you received: 2
1 hour 59 minutes ago #366210

Ok, I'll try to explain :)

I would like to create an interface similar to the current shopping cart block, where the quantity of an external stock would be displayed.

If the visitor doesn't have the right quantity in the internal stock, he could use the external stock control to select the extra quantity that suits him and I would send this in an email to the email address set in the admin interface (e.g. using rsform).

So the basic add to cart button would do the usual hikashop procedure, while the second block would do the external warehouse enquiry.

Visitor selects a quantity, adds to list, goes to next product, adds to list. Then at the end he sends this information (e.g. by clicking on a button in a modal) and I can contact him based on this

We have a lot of types of products, few in internal stock, more in external stock.

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

Time to create page: 0.052 seconds
Powered by Kunena Forum