Author Topic: Product preorder with custom price  (Read 279 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 272
Product preorder with custom price
« on: May 21, 2019, 07:45:28 am »
Could you please suggest a solution for this topic:
There is a shop where some products have release date. The shop owner wants to put these products to the shop and give the possibility to place a preorder for them.
The preorder process could be similar like whitelist or flag the product somehow, at this point we don't need to collect the userinfo, or the money.
But the twist is: there is a custom preorder price for the product.
Like the regular price is $15 but the preorder price is $12. When the customers preorder/flag/whitelist the product before the release date, they should be pay the lower price after the release date as well, when the normal price is active.
Any guess for this?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3846
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Product preorder with custom price
« Reply #1 on: May 21, 2019, 11:01:36 am »
I think that a custom field or a Joomla system plugin can do it.
When the product is added to cart, you can set a date for eg. in this field.
When the user come back, the plugin check for the saved value and apply the discount if the product was not already ordered.
I dont know another safe solution.

sandomatyas

  • Jr. Member
  • **
  • Posts: 272
Re: Product preorder with custom price
« Reply #2 on: May 21, 2019, 16:59:49 pm »
hm. Sounds like a plan :)
Could you help me how should I set a custom price/discount for the selected product? Which method should I use for that?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3846
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Product preorder with custom price
« Reply #3 on: May 21, 2019, 17:38:42 pm »
hm. Sounds like a plan :)
Could you help me how should I set a custom price/discount for the selected product? Which method should I use for that?
I think that a custom field or a Joomla system plugin can do it.
If you are not a programmer, it's to long to explain. If you are, then you should understand what i wrote ;)

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2178
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Product preorder with custom price
« Reply #4 on: May 21, 2019, 20:43:02 pm »
I have solved it a bit different. With some overrides in productdetails and back en invoice creation i check if the avail date is passed if not, it is preorderable as any product. They can checkout and pay for the product. It will be sent when it is available. You can also create a "preorder" payment option from standard payment that doesn' t require payment until in stock. But it all depends on the fact that they are booked by the customer to make it work.
Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

sandomatyas

  • Jr. Member
  • **
  • Posts: 272
Re: Product preorder with custom price
« Reply #5 on: May 22, 2019, 06:15:34 am »
hm. Sounds like a plan :)
Could you help me how should I set a custom price/discount for the selected product? Which method should I use for that?
I think that a custom field or a Joomla system plugin can do it.
If you are not a programmer, it's to long to explain. If you are, then you should understand what i wrote ;)

Hm you wrote "When the user come back, the plugin check for the saved value and apply the discount if the product was not already ordered."
If I'm right I need to set a discount somehow.
There is a setCouponCode in the VirtueMartCart class but this is not a coupon.
I created a special vmcustom plugin before to solve an other task, and there I used plgVmPrepareCartProduct's $modificatorSum to set the price.
I was wondering if you suggest another solution or should I use this plugin method for this topic too?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3846
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Product preorder with custom price
« Reply #6 on: May 22, 2019, 17:43:36 pm »
You can check for the date and apply the custom field price.
If you need to get price after. You should save the date in a table for eg.
Else you can use the saved cart and check the product preorder date
In all case your user have to be registred.