News:

Support the VirtueMart project and become a member

Main Menu

Use customfield to hold additional information of production

Started by derekwcc, June 30, 2016, 13:54:01 PM

Previous topic - Next topic

derekwcc

Hi,

I am currently working a project that needs to use customfields to hold additional info for a product. The requirement is this.

A customfield called Delivery Lead Time is created for product and is assigned a value ( e.g. 5 days, 7 days , etc..) to each product. For example, say an order has 3 items where their Delivery Lead Time for each product are 3 days, 5 days and 7 days respectively. The rule is to determine the longest delivery time among them and display it to the cart. e.g The time to deliver this order is 7 days.

I can sort of do the code to get all customfields but don't know how to put the rules into coding.

Thanks for any help out there in advance.

Derek

AH

Why have you decided to use customfields??

There is the product_availability setting for such things


You can then determine using simple logic, which is the greatest availability and therefore what to show in cart by using the product data arrays in the cart data
Regards
A

Joomla 3.10.11
php 8.0

Studio 42

I have wrote a shipment plugin for a similar case.
The idea is simply. you search for all product the field you need to compare and display the result as a standard Joomla message.
If you use only a proudct customfield is a little more complex because you need to get cart and verify if this is already called or not.
Another solution is to check in the template product. SO you have more flexibility.
So the question is how you want to display it, what field you control (standard or customfields), do you need it in the order too ... after we can perhaps answer your initial question.

derekwcc

thanks for all the advises out there. I'll have a look at the ideas and will post again if I have more questions. thanks again. Derek