News:

Looking for documentation? Take a look on our wiki

Main Menu

Custom Field checkbox to add free sample

Started by OliviaH, July 04, 2016, 15:58:53 PM

Previous topic - Next topic

OliviaH

Never said I didn't want the cart changed.
Flagging it is helpful but if the price isn't changed to 0 then the customer would be charged the product cost, no?

GJC Web Design

It wont of course just by this.. u ten need (I assume) to manipulate the cart to reduce to 0.0001 ..

but this is all suck and see.. I don't need this so I am only making suggestions for you to follow thru on

look for example how the vmcustom textinput plugin manipulates the price in cart

public function plgVmPrepareCartProduct(&$product, &$customfield,$selected,&$modificatorSum){
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OliviaH

Thank you for your help. But I don't know enough about how virtuemart works or php to figure how it all works on my own.
I'll have to stick to the extra products for now.
I appreciate your help but I am just not experienced/knowledgeable enough to work it all out.

balai


OliviaH


balai

By letting you add to the cart a main product together with your free one.
Just thought that could be helpful. You can check it and decide

OliviaH


GJC Web Design

1. you don't want to use products
2. u don't have the skills to code an alternate solution

solution?  Hire someone with the skills....  unlikely anyone here is going to use their time to code your website - that's the way the world works...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OliviaH

#23
Well my question initially was how to make a custom field a checkbox or set the price to 0, don't see how that's asking anyone to code my website.
I was asking for help, all you have to say is, well, nothing if you don't wish to help.

jenkinhill

Abuse of other forum members is not acceptable behaviour. You have been offered suggestions by an experienced developer developer giving up some of his free time to try to help. You are ssking for something that no other forum member has asked  before, and as you believe that none of the suggestions are helpful there comes a point where you should commission a developer/programmer to solve the problem for you.
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

OliviaH

I did actually thank him for his help:
Quote from: DanBH on July 06, 2016, 10:52:39 AM
Thank you for your help. But I don't know enough about how virtuemart works or php to figure how it all works on my own.
I'll have to stick to the extra products for now.
I appreciate your help but I am just not experienced/knowledgeable enough to work it all out.

So I felt rather offended when told:
Quote from: GJC Web Design on July 07, 2016, 18:20:16 PM
that's the way the world works...
Since I was only asking if he could help, not demanding it, if he couldn't help he didn't need to talk down to me just because I know less than him.

But you can rest assured it will not happen again.
(PS I would have written this in a PM to you jenkinhill, but I don't know the correct procedure here. Is there a place that has all the forum rules, can't seem to find it)

Studio 42

Hi DanBH,
If you need a specific changes then try to be specific.
Free sample is possible using a customfield list and minus the price in the variant.
Another solution is to use child variant with price 0.
In all case if you give free sample, for same product, the stock is changed. So for stock you need to use a child variant, or a product "free sample"(you can use related product for eg.)
If you need free sample for many product and dont want use the child variant, related... then you can check for a developer, to do it.
Another solution, is to use a button+javascript displayed in product, that add a free sample with the right information.
In all case, or you need to add in all products the option. Or develop a code to do this automatically.

Do not think that GJC, never help, but time is money, and we cannot always loose time, when you do not can do it or not test the proposed solutions.

Regards,
Patrick

OliviaH

#27
Where my questions not specific enough??

Quote from: DanBH on July 04, 2016, 15:58:53 PM
So my questions are:

  • How can I make the Custom Field a checkbox rather than radio button.
  • How would I make the custom field a set price rather than it adding/subtracting a value from the price.

Serious question, as I thought I was really specific and made my questions generic, I just added why I wanted these changes incase I was missing a really obvious solution.
Like I said before I appreciated the help, just not being belittled, even when I had said I couldn't figure most of it out so would go with the option I was trying to avoid but sadly could not.
Also a developer just isn't an option as my company will not pay for it, it has been put onto me to make these changes.


PS. We don't use stock on our website, so luckily I don't have to worry about that.

Studio 42

If you really need to change price, and use ratio button.
Best solution at all, is to do a plugin.
Check the custom field text input plugin, and change the code for your need, this need only some line changes.

OliviaH

I have had to go with the solution of making a sample product for each product.
Custom fields as far as I can decipher, can only deduct from the price, rather than set it, which is what I would need to do.
If there is a way to edit the custom text input plugin I have not been able to figure it out.

PS. I have tried to use the plugin, as well as all other custom fields, the code is just a bit beyond me, at least how virtuemart works is a bit beyond me. I could do the radio buttons, but I would need to make this a checkbox or button to achieve the ease of use we want.
But thank you for your help.