News:

Support the VirtueMart project and become a member

Main Menu

product duration

Started by berges, January 13, 2012, 15:40:15 PM

Previous topic - Next topic

berges

it possible to adding time gestion for product ?
a start and end time for product
it for place of concert i use virtuemart to sell place of concert
thanks for all

PRO

Its not in the core,
but what you could do is disable the add to cart after a certain date.

for example, you use the the product availability date as starting.

Then use the availability field for the amount of days it will stay active after.

Then wrap the add to cart in an if statement to not show it if after that many days from availability date.


berges

ok dommage because 
Quotethe amount of days it will stay active after
it not the same for each product ...
it can be interesting to insert it in core ...
with an end date we can do specific category page how doesn't display past event .. end more
thanks for you reply

jenkinhill

You will need to write or commission a plugin for this, which is a very specific request. Never edit the core as this will get overwritten during any updates (and there will be periodic security updates as well as bug fixes.

There are booking components for Joomla and other systems that would already have this capability. I certainly would not use VirtueMart for this.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

berges

did you now a ticket shop for music event for joomla ??

supermac

I made the error to use VM2 for a ticketing site and I'm still fighting to adapt the system to my needs everyday.
In example, I'd to set as "unpublished" products related to event in past days... I solved in this way:

$today = date("Ymd");
$mysqli = new mysqli($nomehost, $nomeuser, $password, $dbname);
if (mysqli_connect_errno())   {
   exit();
}else{
   $mysqli->query("UPDATE jos_virtuemart_products SET published = 0 WHERE published = 1 AND (Left(product_sku,8) < '$today')");
}
$mysqli->close();

This simple code set the published state to false when the current date (ie 20120117) is higher then left 8 chars of product sku (ie 20120116).
Evidently in first 8 char of sku I setted the expiring date of the product. 
The code is stored in a php page included in VM's entry page so it is read/executed every time an user enter the site, but yes ,I've to remember to edit the page at every VM's update.
I wish this will be helpful for someone, but I confirm that VM is not the right system for ticketing websites.