Author Topic: product duration  (Read 3594 times)

berges

  • Jr. Member
  • **
  • Posts: 66
product duration
« on: January 13, 2012, 15:40:15 pm »
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: product duration
« Reply #1 on: January 13, 2012, 20:33:06 pm »
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.

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

berges

  • Jr. Member
  • **
  • Posts: 66
Re: product duration
« Reply #2 on: January 16, 2012, 09:23:16 am »
ok dommage because 
Quote
the 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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27388
  • Always on vacation
    • Jenkin Hill Internet
Re: product duration
« Reply #3 on: January 16, 2012, 11:33:12 am »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.3.10057 on Joomla 3.9.6 PHP 7.0.33
Testing VM 3.4.5.10059 on Joomla 3.9.6

berges

  • Jr. Member
  • **
  • Posts: 66
Re: product duration
« Reply #4 on: January 16, 2012, 11:39:28 am »
did you now a ticket shop for music event for joomla ??

supermac

  • Jr. Member
  • **
  • Posts: 68
Re: product duration
« Reply #5 on: January 17, 2012, 10:55:00 am »
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.