Hello there
I have a specific problem where I need a little bit of support. I would like to change the product page in a special way for items that are restricted and need a permit to buy. It's about a gunstore (please don't blame me... I already had some negative responses in the Virtuemart-Forums, when I tried Virtuemart )
The store is 100% legal but I need to change the product page, so that some Items cannot be put into the cart.
First of all, I added a new custom field to the products table by Hika-Admin-GUI. With this, I can "mark" items like guns and ammunition (they cannot be sold online).
Currently I used a "trick" that these products are not sellable: I set the quantity to zero and removed the text for the "Out-Of-Stock"-Message from the languages ini file. So there will be no "Add-to-Cart"-Button and also no message "Out-Of-Stock" (the message shall not appear, not that the customers think I'm Out-of-Stock). That worked pretty good so far, but I also sell items like Oil or Sights in the store as well (not restricted) and for these items I would like to have the "Out-of-Stock" text. As you can see, it's not so simple.
What I planned is: I just create a new product layout page and assign this new, adapted product page to the corresponding items (like guns and ammunition). I would copy the existing default page layout which is very nice and change the following things:
- Remove the "Add-to-Cart"-function
- Add a hint-text (red with a red square around it): "This product cannot be bought online! Please contact us for further information!" or something like that (please find an example in the attached pic).
- Out-of-Stock message (since I don't need a Stock for these items)
But here comes the problem(s): Where can I find the product layout files? Is there a help with the PHP-Code from the files? How, does the files work together? I can code a little bit, but not PHP and therefore, I'm helpless at the moment because I don't know where to "put the lever and pull".
Or maybe you have some better ideas, how can I solve my problem? I'm not a fan of changing or adding some own code to the store, since a later Update may be a pain, but I see not other way to do it (or do I miss something?).
For some tips and help, thank you very much.
Best regards
Mike