Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Mark a product as New from date to date

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-22-2011, 12:14 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #2  
Old 01-25-2011, 04:31 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #3  
Old 01-25-2011, 04:36 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 01-25-2011, 04:56 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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?
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #5  
Old 01-25-2011, 05:12 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

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

Yes I can do that. Feel free to email me
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 01-25-2011, 05:34 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #7  
Old 01-25-2011, 06:14 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 01-25-2011, 06:18 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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.
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #9  
Old 01-25-2011, 06:46 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #10  
Old 01-25-2011, 12:15 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default 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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:30 AM.

   

 
X-Cart forums © 2001-2020