| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Showing Accessories for Product(s) | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Showing Accessories for Product(s)
What it is & how it works:
Live demo: http://headsetinnovations.com/cart/product.php?productid=16266&cat=250&page=1 Screenshot: Description: What it does is include the products listing for a defined category (Accessories) and lists them under a defined product. Product & Accessories associations are stored in the x-cart MySQL database for fast processing. Installation: 1. Create a table in your x-cart database called 'sub_accessories' by running the following MySQL Query: Code:
2. Create a directory under /cart/skin1 called 'subaccess' in that folder create a file called 'subaccessphp.tpl' and put the following code in subaccessphp.tpl: (Make sure you put in your MySQL databse & login information AND CHANGE 'change-to-your-store.com' to your website URL below...) Code:
2a. Then create a file under the same dir (cart/skin1/subaccess) called 'subaccessdiag.tpl' and put the following code: (This is the template that controls how the accessories are listed) Code:
2b. Create a file under /cart/skin1 called 'product_thumbnail_secure.tpl' and put the following code: Code:
3. Create a file under /cart called 'subaccess.php' and put the following code: Code:
4. Then go to cart/skin1/customer/main/product.tpl and at the very bottom add this code: Code:
5. Now its time to associate products with their accessories. each field under the sub_accessories MySQL table has a purpose: active: 0=Disabled, 1=Enabled (Use this to turn accessory listing on or off) productid: (Set this to the productid of the product you want it to list under. You can get the productid by looking at the url where it says 'product.php?productid=16266' 16266 would be the product id you would enter. cat: (Set this to the category where your accessories are. So if you accessories are under Accessories > Product go there and look at the url and get the cat #. E.G. 'home.php?cat=628' 628 would be the cat id you would enter for your accessories. Example MySQL field setup: active: 1 productid: 16266 cat: 628 This would list accessories for productid 16266 by including products in cat 628. You can create multiple records for as many as you want! Well, I thought I would share this with everyone just in case some one had a use for this. Im not php expert im still learning PHP. Im sure there are some better ways to do some of this but this is how I have it and it works GREAT! Any suggestions/comments are welcome. Thanks, Austin Changelog: [10/30/05] - Removed MySQL login/pass & db info and added the following in subaccessphp.tpl: Code:
Code:
I have edited the the code above to reflect this change.
__________________
X-Cart: 4.0.13 [Linux] |
|||||||||
#2
|
|||||||
|
|||||||
Just wanted to say this looks like a great mod! Good work.
Don't know that I have a use for it - but it's good to see somebody else actively mod'ing on their own instead of digging for free answers
__________________
Instinctual 8,000 feet up in the Rocky Mountains of Colorado X-Cart Versions 3.5.x - 4.0.x IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind. |
|||||||
#3
|
|||||||
|
|||||||
nice mod
Love the mod! I'm new at this and would love to use it I just need to know where I put the:
Example MySQL field setup: active: 1 productid: 16266 cat: 628 do I put it in product.tpl or in the subaccess.php? sorry like I said I just got this program and not a programer
__________________
Christmas x-cart 4.1.6 |
|||||||
#4
|
|||||||||
|
|||||||||
That is something you want to put in your MySQL table... You can do it by running this MySQL query:
Code:
Change 12345 to the productid that you will be displaying accessories under. Then change 123 to the cat # of this category you will be listing under that product.
__________________
X-Cart: 4.0.13 [Linux] |
|||||||||
#5
|
|||||||||
|
|||||||||
bit useful for selling vehicle spare parts.
__________________
Dongan MercuryMinds Technologies Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com Follow us at Facebook / Twitter |
|||||||||
#6
|
|||||||||
|
|||||||||
HI anoack,
Great Mod thank you very much
__________________
X-Cart Gold 4.3.2 X-Cart Gold 4.4.1 Unix High Quality CCTV DVRs & Cameras http://www.eaglemobiles.co.uk/CCTV |
|||||||||
#7
|
|||||||
|
|||||||
anyone actually apply this and have luck with it? Just curious before trying it out
|
|||||||
#8
|
|||||||||
|
|||||||||
I have made some small changes to the code as I have advanced in my php skills.
Changelog: [10/30/05] - Removed MySQL login/pass & db info and added the following: Code:
__________________
X-Cart: 4.0.13 [Linux] |
|||||||||
#9
|
|||||||||
|
|||||||||
Quote:
If you have any proplems with installation post it here or just PM me. Note: It is currently working with the version of X-Cart I have in my signature.
__________________
X-Cart: 4.0.13 [Linux] |
|||||||||
#10
|
|||||||
|
|||||||
THANK YOU! I have a designer with lots of add ons to her products and this would really increase sales for her.
|
|||||||
|
|||
X-Cart forums © 2001-2020
|