X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Mark a product as New from date to date (https://forum.x-cart.com/showthread.php?t=57678)

ADDISON 01-22-2011 12:14 PM

Mark a product as New from date to date
 
I searched this forum but I did not find information about setting up a product as new from date to date.

If someone knows the right thread please give me flash.

ADDISON 01-25-2011 04:31 AM

Re: Mark a product as New from date to date
 
If someone wants to give it a try, here are some idea.

Backend:

- a new check box (Mark Product as NEW) and 2 input boxes (From To). This can be done using jQuery Data Picker (data range): http://jqueryui.com/demos/datepicker/#date-range. In General Setting you have to set up the time by default, let's say 30 days in case you mark a product as NEW but no range is defined.

Frontend:

- php file extracting from database the range a product should be marked as NEW. if no range, you can use by the default specified in General Settings.

- template file - if product is new, use some graphics to show the product is NEW. Over the product image using CSS, inline, how do you prefer.

cflsystems 01-25-2011 04:36 AM

Re: Mark a product as New from date to date
 
This can be easily done by adding 2-3 new fields to products table - checkbox for new, date to, date from. Some php code changes to read/save the new fields and template edit to show something based on this new info. Not thard to do

P.S. So many users are asking for this, QT still can't spend 30-40 min to put it in by default

ADDISON 01-25-2011 04:56 AM

Re: Mark a product as New from date to date
 
I know. It is one of the most requested feature in all these years. This could bring real life in your stores. Based on studies, most of the customers would like to see new products, which means "activity" in that store.

Could you that?

cflsystems 01-25-2011 05:12 AM

Re: Mark a product as New from date to date
 
Yes I can do that. Feel free to email me

amy2203 01-25-2011 05:34 AM

Re: Mark a product as New from date to date
 
the add_date of an item is already there, so you could just use that. I've got something similar on my store, I can't remember if I had to make any php changes, but in my template I've got:

product.tpl
Code:

{if (($smarty.now)-$product.add_date lt 2592000)}
<div class="stickernewlarge"></div>
{/if}


then my css file adds the image,

hth

cflsystems 01-25-2011 06:14 AM

Re: Mark a product as New from date to date
 
Yes using the add_date field works too the way you have it. I don't think changes to tables or php are required. The only thing will be if you wan to bump that product as new again you will have to change add_date to more recent one. But yes that is the simplest way to do it and works

amy2203 01-25-2011 06:18 AM

Re: Mark a product as New from date to date
 
yes, it doesn't give you a variable timescale, mine is set to 30 days.

ADDISON 01-25-2011 06:46 AM

Re: Mark a product as New from date to date
 
Could you post it here?

Once you done the job, I will ask QT to make this available by default in all future versions.

Quote:

Originally Posted by cflsystems
Yes I can do that. Feel free to email me


cherie 01-25-2011 12:15 PM

Re: Mark a product as New from date to date
 
We've used the same Smarty code as amy2203.

You can also use Extra Fields to add a flag to a product to indicate if it should show something like a New badge.

I haven't seen a need to customize the database for something like this.

ADDISON 01-25-2011 12:28 PM

Re: Mark a product as New from date to date
 
In some markets/countries customer reaction is very very delayed. So, setting a product from time to time is the best option in this case.

Anyway I thank all for your solutions. Keep going!

philrisk 09-28-2011 06:21 AM

Re: Mark a product as New from date to date
 
Quote:

Originally Posted by am2003
If someone wants to give it a try, here are some idea.

Backend:

- a new check box (Mark Product as NEW) and 2 input boxes (From To). This can be done using jQuery Data Picker (data range): http://jqueryui.com/demos/datepicker/#date-range. In General Setting you have to set up the time by default, let's say 30 days in case you mark a product as NEW but no range is defined.

Frontend:

- php file extracting from database the range a product should be marked as NEW. if no range, you can use by the default specified in General Settings.

- template file - if product is new, use some graphics to show the product is NEW. Over the product image using CSS, inline, how do you prefer.


Has anyone built this yet?

JWait 10-02-2011 02:58 AM

Re: Mark a product as New from date to date
 
Quote:

Originally Posted by cflsystems
Yes using the add_date field works too the way you have it. I don't think changes to tables or php are required. The only thing will be if you wan to bump that product as new again you will have to change add_date to more recent one. But yes that is the simplest way to do it and works


There is something to be aware of when using add_date, if you import anything to an existing product via .csv the add_date will be changed to the current date... at least it did the last time we did it.

This may have changed on more recent versions of x-cart than the 4.2.3 version we are currently using, I don't know. Just something to be aware of or you may get unexpected results... like everything being marked as "new". 8O

cflsystems 10-02-2011 06:58 AM

Re: Mark a product as New from date to date
 
Yes this is correct, if you don't import date XC will use current date and replace the existing one. This along with the clean urls (if you don't specify them in the import file XC will generate them again overwritting your custom urls even if they exist in the database) is like a bug as the import should not regenerate data if not supplied by the import file and exists in the database. QT will tell you it's a feature :)


All times are GMT -8. The time now is 05:03 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.