| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Clearence Items Mod | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Clearence Items Mod
Can someone please help me with a mod I'm trying to put together regarding Product Clearance items.
I have created a category called "Clearance" and have added several clearance products to it. What I would like to do is display some of those products on the home page and show them in random order. So this is what I need... I need the following code in my clearance.php file to query the database for all products in the "Clearance" category and select 5 of those products in random order (oh, and btw, I have already completed the clearance.tpl file so I don't need any help there... just the php). Here is the code I need to modify in my clearance.php file: Code:
If I can get this mod to work, I'll post all code and instructions here for everyone to see and use.
__________________
X-Cart 5.3.5.4 |
|||||||
#2
|
|||||||
|
|||||||
Anyone?
__________________
X-Cart 5.3.5.4 |
|||||||
#3
|
|||||||||
|
|||||||||
select * from xcart_products a, xcart_products_categories b
where a.forsale = 'Y' and a.avail > 0 and a.productid = b.productid and b.categoryid = '123' order by Rand() limit 5 you need to use "xcart_product_categories" table, not categories. |
|||||||||
#4
|
|||||||
|
|||||||
Thank you ETInteractive.com
Well, IБ─≥ve done it. Finally! I said I would share, so here it is. What does it do I hear you ask? ThisБ─╕ This mod searches a particular category and displays the contents at random on the home page. In my case, I have a Б─°ClearanceБ─² category that I wanted to highlight. This mod works great on x-cart 4.1.13. I should also note that this mod is based on the Б─°SpecialsБ─² mod posted by funkydunk but is, by large, different because it only focuses on one single category instead of the entire database. The mod can be configured to display any number of products (currently set to 5) and you can nominate any category you like by simply modifying the product id (currently set to Б─°278Б─²). I should also mention that this mod will display the following product information: Product thumbnail (25 pixels wide) Product name Product list price (with a line running through it) Product price (Note: You will have to edit the clearance.tpl file (below) if you want to add, modify, or remove any of the above information) Here is a an image of what it looks like in my store (currently under construction and closed... sorry). [SCREENSHOT WAS REMOVED FROM HERE] So without further delay, this is what you need to do: Create a file called clearance.php in the xcart root directory and paste the following code into it. Save the file (check if you have write permissions first). Keep in mind that you will need to either nominate and existing category, by replacing 278 with your own, or create a new one. You don't have to call it "Clearance"... any name will do. Also, don't forget to add some products to it too. If you want a higher or lower limit than 5 just replace the 5 with the figure you want. Code:
Code:
Just after this: Code:
Now, in you welcome.tpl (or where ever else you want this mod to show) add the following code: Code:
Now, somewhere in the middle, add the following code to the skin1/customer/home_main.tpl file: Code:
Now create a file called clearance.tpl in skin1/customer/main directory and paste the following code into it: Code:
__________________
X-Cart 5.3.5.4 |
|||||||
#5
|
|||||||
|
|||||||
Just one more thing, and it's optional too. If you want to include a link so the customer can see all the products in the Clearance category just add this line to the clearance.tpl file (remember to change the categoryid number to your own):
Code:
Code:
Now it's complete! \
__________________
X-Cart 5.3.5.4 |
|||||||
#6
|
|||||||||
|
|||||||||
moved to custom mods
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#7
|
|||||||
|
|||||||
I am getting this error when I try to implement this mod.
Looked pretty easy and straight forward. I changed a small snippet in the code to get to my xcart_categories, but other than that, the only thing changed was the category Id. Here is the error: Quote:
Here is the code in clearance.php: Code:
Any idea of what may be happening to me here? I am trying to use this in an older 3.4.x branch version
__________________
vs 4.1.12 |
|||||||
#8
|
|||||||
|
|||||||
Why did you change xcart_products_categories to xcart_categories?
You are having this problem because xcart_categories does not hold productid information... xcart_products_categories does. Look at your xcart_categories table and see if there is a column named productid in it (try using phpMyAdmin in C/Panel to do this). If you canБ─≥t find it, then the whole thing won't work. If you don't have an xcart_products_categories table, what you probably need to do is search for a similar table with a different name but it must have the productid info in it. Unfortunately I don't have your version of x-cart so I am unable to be of great assistance. Perhaps someone else here in this forum that is more experience with your x-cart version, can suggest a solution. It definitely has something to do with what I suggested above so it won't take much to fix it. Sorry I can't be of further assistance. Let me know how you went.
__________________
X-Cart 5.3.5.4 |
|||||||
#9
|
|||||||
|
|||||||
Thanks for the reply so soon.
I changed this to xcart_categories due to my not having the xcart_products_categories. However, something you said about the dategory id AND product id gave me an idea and I looked at the xcart_categories and it does not have the product id, so I went to my xcart_products and it has the product id and category id. So, saying that, I will upload the files once again and try this using xcart_products. I bet this does it, I will just need to tweak a bit and try it out. I will post if this does it or not to share. If it does not, I hope to hear from someone else that knows. Looks like all of the info is there though, so I will give it a shot. Thanks again
__________________
vs 4.1.12 |
|||||||
#10
|
|||||||||
|
|||||||||
Thanks Online Michael for sharing this great mod, how display this code side menu.
Thanks
__________________
X-Cart Gold 4.3.2 X-Cart Gold 4.4.1 Unix High Quality CCTV DVRs & Cameras http://www.eaglemobiles.co.uk/CCTV |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|