![]() |
Special Offers Module
I have now completed a special offers part to show them on the home page. the code is as follows:
First create a specials.php file in xcart/customer this selects 6 items at random that are marked as discounted from the main/market price. Code:
<? Then add the following line into customer/home.php after the require featured proudcts bit. Code:
require "./specials.php"; Then amend welcome.tpl to add the following code to where you want it to appear: Code:
{include file="customer/main/specials.tpl" specials=$specials} Then amend skin1/customer/home_main.tpl to: Code:
{if $smarty.get.mode eq "subscribed"} Then and we are nearly there now !! :wink: create a special.tpl in skin1/customer/main as follows: Code:
{capture name=dialog} You will see that I have added two extra fields into the languages, one to display if there are no special offers and one for the title to the main box. Enjoy. Funkydunk |
Well done mate,
Your coming up with some great addons of late. Hats off to you :-) |
Necessity is the father of invention. :wink:
Just had a client who needed these bits so I put them together. Thanks for the feedback. There's more coming! |
Hmmm...
I was thinking of doing something like this but I wanted it to be something like Bargain of the Day or Week.
I wanted to give everything a Bargain Price. The script would randomly pick an item for the time period. It would just need to check against a timestamp to see if it needed to generate a new bargain or run a cron job. I would also want it to show the Bargain Price on the product page. The one problem I see with yours is couldn't a customer simply continue to reload the page until it loaded the item they wanted to get the discount? |
It doesnt matter i suppose as all the items that will show up are chosen from the list of products that you have set as discounted.
This just puts a few on the front page to show them off |
Shan,
Bang on. If you haven't selected a discount it wont pick it..simple as that. Now getting the system to do a discount automatically, now that is another thing, not sure how that would work. :? |
Anyone created this as a side menu like the bestsellers has ?
|
Shan,
Yep - Am building a site at the moment with this in a lhs menu. Limited it to show 3 products though cos of space. |
Quote:
How about one random discounted product or the option for more? |
I look forward to seeing the code :wink:
Haven't got time to amend this myself at the moment - clients come first - , but feel free to amend away and post your results. |
Quote:
How is this coming along? |
This has been done.
lhs menu shows a selection of three products that have a discount applied then a link to a special offers page that lists all products with the normal navigation through the pages. |
How much is 120L in dollars?
|
120 what?
|
Your site says that that mod costs 120L.
|
sorry - you lost me then... the L is actually a бё GBP
if you pm me I can confirm details of costings etc. |
Does anyone know if this works in 3.5.x?
I need this for a client with 3.5.4 but we want to modify it to just randomly pull 6 items from the database to display without being dependent on the item being marked down. In other word he does not show marked down items but want the home page to always be fresh. UPDATED: See my fix below to use this with or without discounted products in 3.5.x! |
I am getting this error after I add - specials.php in home.php
INVALID SQL: 1054 : Unknown column 'discount' in 'where clause' SQL QUERY FAILURE: SELECT * FROM xcart_products,xcart_pricing WHERE forsale='Y' AND avail>0 AND xcart_products.productid=xcart_pricing.productid AND discount > 0 ORDER BY RAND() LIMIT 6 Version 3.4.0 |
just change the following code in specials.php
Code:
<? to Code:
<? This will just randomly pull products from the database regardless of any discounts. And if you only want to show products you have discounted from the list price use this: Code:
<? Change LIMIT 6 to any number of products you want to show in the specials.tpl Also be sure to name the specials template specials.tpl. I noticed in the original code it was named special.tpl. I have tested this in 3.5.4 and works like a charm :D hth |
Great Thanks Works Perfect.
Also Is there anyway to modify this to be shown on help section page - like about us page. |
No problem.......
If you want to add this to other pages just add the include, in the case of the about us page add the include to skin1/help/about.tpl where you want it to appear: Code:
{include file="customer/main/specials.tpl" specials=$specials} You also need to add the require to the appropiate .php script, in this case it would be xcart/customer/help.php. Just add the require below the last require in that script: Code:
require "./specials.php"; Enjoy! |
great, I will set it up somewhere where it will show more products on about.tpl instead of 4, i will put about 12.
Thanks. |
I have a client that wants this mod to show the newest products only in the last 60 days. Can anyone tell me what argument to use?
I suppose it would tie to the add_date timestamp in the xcart_products database, something to the effect of "AND < 60" where 60 is the number of days from the current day we want to show the newest products, I just need to know what the proper format would be for the unix timestamp and how to show only products "less than 60 day old". |
unix time is in seconds
therefore 60 days is 60*60*24*24 |
Duplicate Entries
So I get duplicate entries in the Specials section frequently, and always if I only have one item on special. Am using the RAND function so can understand when more than 4 products on special, but it always shows two off the same item when it's only one product. You can see it at http://hydrangeasplus.com and hit refresh a couple of times and you'll see duplicates. Not a real big deal, but still curious. Any ideas?
|
Here's one for anyone running this with 4.0.3.
Using this mod it does not display the price, It displays this instead: "enter your price". I am working on finding the fix for this but if anyone can help it would be greatly appreciated and it sure would help others that use this in 4.0.x branch of xcart. Likewise, if/when I figure out a fix I will post it here. |
Quote:
Please do, I am currently upgrading a store to 4.03 and was wondering what changes may be required to get this workable for the newer version. Thanks to those that may be of help |
What a great mod, thanks a lot, have been using it for a little while and its working a treat. 8)
|
Quote:
thanx :) |
funkydunk,
Quote:
Have any idea what to change in the script to get it to work properly with 4.0.3? I have not had time with my schedule to check into it yet. |
sweet
|
Quote:
Change specials.php to this one: Code:
<? Example: http://www.shopping-carts-upgrades.com/ :wink: |
Quote:
Your wish is my command.... :wink: Here is the code: Replace the entire code in the specials.tpl with this: Code:
{* $Id: specials.tpl,v 1.3.2.1 2004/11/16 11:15:01 max Exp $ *} Insert the following line of code where ever you want the specials to appear in the skin1/customer/home.tpl file: Code:
{include file="customer/main/specials.tpl"} That's about it...enjoy :D Oh, and btw, this works fine on 4.0.13 |
Hello,
I am kind of lost here, can somone please recap and put all mods together, and show final instructions exactly what needs to be done to get this mod to be working. Thanks you, |
Hi, me again I figured it out, its working, great!
However is there a way to select a category or categories from which you only want to show the discouted products in the "Hot specials" list? I mean I have 10 categories, but I only want to show products from 3 of them in the "Hot specials" list. Thanks Tom |
Hello ..
Will this mod work with v4.0.15 ? Thanks & Regards :sK |
Quote:
Yup ... seems to ... :sK |
How do you limit this mod to to show only one category
|
yages,
check out this Clearance mod if you just want one category limit: http://forum.x-cart.com/viewtopic.php?t=20781&highlight= Hope this helps :) |
Hello,
I am kind of lost here, can somone please recap and put all mods together, and show final instructions exactly what needs to be done to get this mod to be working. Thanks you, |
All times are GMT -8. The time now is 04:36 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.