| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Customized Product Options | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Customized Product Options
I made this mod (v 4.0.16) as a client wanted only a few categories to have a certain type of option. The client also the options displayed as radio buttons with an image. I did not want to mod the Produce Options module directly as the cliented needed it for all other products. This mod does the trick if you don't mind the manual update. For those interested in having something like this integrated into the admin, it can be done as well with some extra work. (replace 'skin1' with your actual skin dir):
1. Create a new product, ensure it is disabled and label accordingly so you know this is your pseudo product. Next add options as you would a regular product, adding all the options you would like. Note the class ID number. 2. Access database directly or through phpMyAdmin. Browse the table x_cart_class_options and you will see all the options you created, associated with the class ID you noted from step #1. Copy down each optionid for this particular class. Next, browse the xcart_categories table and note each categoryid that you want this product option to show up in. 3. Lets create the .tpl for our new option look. Create a new file in /skin1/customer/ ... name it anything but ensure it has the .tpl extension. It should look like the following, replace 60 with your classID, each value with the optionID you got from the database, and replace images as necessary: Code:
** Also ensure you create a language variable for the label used above 4. We need to register the strstr() PHP function in /product.php so Smarty can access it in our .tpl file (someone please let me know if Smarty already has this functionality!) Code:
5. Open /skin1/customer/main/product.tpl ... and include the file from Step 3 just as you would any other .tpl file. I placed mine as follows (you can put it anywhere), and it will only show for a category which is under one of my root categories (24: Code:
I hope this helps someone ...
__________________
---------------------------------- Jeff Thinkweb Media X-Cart 4.0.16 PHP 4.3.2 |
|||||||
#2
|
|||||||
|
|||||||
thanks would give it a try.
much needed. regards Junaid
__________________
xcart 4.18 on linux |
|||||||
#3
|
|||||||
|
|||||||
Cool, thanks for that...
I used a variation of your technique to get a hidden form field added to the product when it was added to the cart. xgarb
__________________
Core version: 5.5.xx |
|||||||
#4
|
|||||||
|
|||||||
I'd love to have this mod if it used checkboxes instead of radio buttons. Any chance of getting it changed to do so? I have an extreme need to list literally dozens of options for musical instruments and allow the customer to select multiple ones. The radio button is for either/or. I need a mod to allow 'and, and, and...'
__________________
www.templatedepot.com PROGRAM: X-CART PRO VERSION: Version 4.0.14 RUNNING ON: Linux Enterprise 3.0 |
|||||||
|
|||
X-Cart forums © 2001-2020
|