Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Product Carousel (SKU# FLEX-00009)

TOPIC: old product shown as new

old product shown as new 11 years 5 months ago #473

Flexible - Virtuemart Product Carousel (for Virtuemart 2.0 only)
Every time i update a product (quanity) it shows as "new" in carousel which is not wright.

Please advice

Thomas
The administrator has disabled public write access.

old product shown as new 11 years 5 months ago #491

Hi,

This is simply impossible, In Virtuemart; there are 2 different dates recorded in the database:

1- created_on
2- modified_on

The 2nd variable is updated when you modify the product, but the first date will never be updated since it shows the date of the product is created. And our Carousel Extension uses the created_on variable while calculating the time difference before showing the "NEW" badge.

See below (this is taken from our carousel extension's default.php)
$createddate = strtotime(($product->created_on) . " +".$newbadgeperiod	."");  
		$today = strtotime(date("Y-m-d G:i:s")); //todays date

Let me explain the PHP variables (in case you are not familiar with PHP)

$createddate is newly defined variable.
$product->created_on = is taken directly from the Virtuemart Database, which is the date when the product is created.
$newbadgeperiod = is a module parameter: you will choose it from Carousel Module parameters, (1day, 1week, 2month etc..)
Then it runs the PHP...IF condition; if the "created date" + "newbadgeperiod" is smaller than "today"; it shows "NEW" badge. IF it it bigger, it doesn't show anything.

It is very straight forward, right?

Something might be wrong with the created_on variable in your virtuemart, which sounds non-sense to me though. Please update any product and remember its product_ID; then browse your phpmyadmin, open the "zhzi2_virtuemart_products" table, Check the "created_on" column of product that you just modified. What do you see? today's date, or the creation date...

Cheers.
The administrator has disabled public write access.

old product shown as new 11 years 5 months ago #849

Yes you are right,


Every time i update a product (quanity) it shows on "LATEST " in carousel which is not right

Please advice

Thomas
The administrator has disabled public write access.

old product shown as new 11 years 5 months ago #850

Yes you are right,


Every time i update a product (quanity) it shows on "LATEST "
Waiting for your response
Thomas
The administrator has disabled public write access.

old product shown as new 11 years 5 months ago #852

Have you checked already what i have said?

Please update any product and remember its product_ID; then browse your phpMyAdmin, open the "zhzi2_virtuemart_products" table, Check the "created_on" column of product that you just modified. What do you see? today's date, or the real creation date...

That DATE shouldn't be updated when the item is modified. It is supposed to remain constant. If not, something might be wrong the Virtuemart you are using. Are you using the latest version?

Another solution can be said; completely disable the "NEW" ICON feature from the carousel module parameters.

Cheers.
The administrator has disabled public write access.
Time to create page: 0.093 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo