| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product Variants and Product Name, Product List Price | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
Re: Product Variants and Product Name, Product List Price
Success!!!! I was using an older post on here to add list price to product variants. I'm testing out 4.4.4 but the post was for 4.1 or 4.2 and the file structure has completely changed since. After spending hours and searching through code I finally got it working (the main part at least).
So from the admin side when you log into product variants you have list price as an extra field. When you fill in the field and click apply changes it updates the database with the list price. I also got the list price to change dynamically with the func.js script on the product details page. Some other things that I still have to work on: 1.) Importing and exporting functionality. 2.) The save% calculation needs to be worked on. 3.) Showing the msrp for the default product variant on the product listings I promise I will post the files I edited and the changes. I figure I needed to give back because I've used this forum hundreds of times.
__________________
X-Cart Pro v4.2.2 [Win] X-Cart Pro v4.2.3 [Win] X-Cart Pro v4.4.4 [Win] |
|||||||||
#12
|
|||||||||
|
|||||||||
Re: Product Variants and Product Name, Product List Price
This is a Product Variant - List Price Mod for X-Cart 4.4.4.
I moved some of the product options .tpl files to my skin folder with the same folder structure so I could modify them without changing the original files. The line numbers are not accurate use them as a reference...just search and find the line of code you are looking for. Modded Files: /skin/your_skin/modules/Product_Options/check_options.tpl /skin/your_skin/modules/Product_Options/product_variants.tpl /skin/your_skin/customer/main/product_details.tpl /modules/Product_Options/product_variants.php /skin/common_files/modules/Product_Options/func.js /skin/common_files/main/product_details.tpl Ok let's get started! First add list_price field to your 'xcart_variants' table in your database. Make sure it is the last entry in the table. I used phpMyAdmin from my site's cpanel: list_price DECIMAL 12,2 /skin/your_skin/modules/Product_Options/check_options.tpl This pulls list_price from the database and puts it into an array. find (around line 40): PHP Code:
add this below: PHP Code:
/skin/your_skin/modules/Product_Options/product_variants.tpl This code adds the list_price field to the admin product variants area. find (around line 115): PHP Code:
add this below (don't forget to add $lng.lbl_variant_list_price to your langauge labels... My label says 'List Price'): PHP Code:
find (around line 133): PHP Code:
add this below: PHP Code:
/skin/your_skin/customer/main/product_details.tpl This sets the id for list_price so later it can be changed with the func.js. find(around line 96): PHP Code:
modify existing line to match: PHP Code:
/modules/Product_Options/product_variants.php Without this code your list_price wouldn't update in the database when you press 'apply changes'. find (around line 122): PHP Code:
add this below: PHP Code:
find (around line 128 ): PHP Code:
add this below: PHP Code:
/skin/common_files/modules/Product_Options/func.js This code updates the list price when a customer selects a variant. And the other code fixes the save % so it changes correctly when the customer changes to a different product variant. find (around line 147): Code:
add this below: Code:
find (around line 58 ): Code:
Code:
/skin/common_files/main/product_details.tpl This code is optional. It disables editing list price from the product management area in admin and makes a link to product variants. find (around line 205): PHP Code:
change to match this: PHP Code:
I compiled this after I modded my site. I have not tested this walk through. This is a complicated mod so forgive me if I missed something.
__________________
X-Cart Pro v4.2.2 [Win] X-Cart Pro v4.2.3 [Win] X-Cart Pro v4.4.4 [Win] |
|||||||||
|
#13
|
|||||||||
|
|||||||||
Re: Product Variants and Product Name, Product List Price
To add to the above - one more file needs to be edited in order to preserve list prices if variants are turned on/off or deleted
Open /modules/Product_Options/func.php and find Code:
and replace with Code:
If using BCS mod for variants with orderby sorting that needs to be added there instead - bug in the mod Code:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#14
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
Does anyone have away to do this in Version 4.4.5?
__________________
4.4.5 |
|||||||
#15
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
This should be standard code in todays market.
Stupid having to keep on adding after each upgrade! If only they listened to their customers
__________________
4.6.1 |
|||||||
#16
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
Ok Got everything where it needs to be, but the price is not changing when you click on the variable. Where did i go wrong.
__________________
4.4.5 |
|||||||
#17
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
Also, the part where it says "don't forget to add $lng.lbl_variant_list_price to your langauge labels... My label says 'List Price'"
Where is that done at? Maybe that is my problem? Thanks for all the help.
__________________
4.4.5 |
|||||||
#18
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
Ok Got everything where it needs to be, but the price is not changing when you click on the variable. Where did i go wrong.
Also, the part where it says "don't forget to add $lng.lbl_variant_list_price to your langauge labels... My label says 'List Price'" Where is that done at? Maybe that is my problem? Thanks for all the help. Quote:
__________________
4.4.5 |
|||||||
#19
|
|||||||
|
|||||||
Re: Product Variants and Product Name, Product List Price
Can anyone give me a hand? I'm stuck and dont know where to turn. Got this far and again it wont change once the variable is clicked. NOt sure what is missing.
Any help would be great
__________________
4.4.5 |
|||||||
#20
|
|||||||||
|
|||||||||
Re: Product Variants and Product Name, Product List Price
Anybody tried this with 4.2?
A real nasty one to tackle, I now have variants that show a higher sell price when they are selected than the 'normal' list price. This does look very 'unselleable, never noticed of thought about this before though Example: Product has three variants; Small, Medium and Large Small costs 10 dollar Medium costs 12 dollars Large costs 14 dollars Normally the basic variant (small) costs 13 dollars So now only with the small version the 'normally 13 dollars, our price 10 dollars' is shown But when the large variant is selected, for example medium, it says 'Normally 13 dollars, our price 14 dollars' .... selling price appearing to be higher than the from price. In cases off rather cheap products with little difference between variantprices one would say that a solution would be to just set the from price at a higher amount than the most expensive variant. But this will look suspicious with higher priced products, cretaing huge gaps between the from and for price with the cheapest variant.
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25 X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many ∙∙ Experience: Somewhere beyond newbie ----------------------------------------------------------------------------------------------------------------------------------------- Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info |
|||||||||
|
|||
X-Cart forums © 2001-2020
|