Author Topic: Custom Field checkbox to add free sample  (Read 4629 times)

OliviaH

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #15 on: July 05, 2016, 16:55:25 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8952
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Custom Field checkbox to add free sample
« Reply #16 on: July 05, 2016, 17:53:31 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OliviaH

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #17 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.

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1375
Re: Custom Field checkbox to add free sample
« Reply #18 on: July 06, 2016, 14:44:45 pm »
Alternatively you can try product bundles.
https://breakdesigns.net/extensions/product-bundles

OliviaH

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #19 on: July 06, 2016, 16:31:01 pm »
@balai I don't see how that would help

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1375
Re: Custom Field checkbox to add free sample
« Reply #20 on: July 07, 2016, 10:10:55 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #21 on: July 07, 2016, 17:54:42 pm »
I don't want it to add both products.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8952
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Custom Field checkbox to add free sample
« Reply #22 on: July 07, 2016, 18:20:16 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

OliviaH

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #23 on: July 08, 2016, 09:01:19 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27479
  • Always on vacation
    • Jenkin Hill Internet
Re: Custom Field checkbox to add free sample
« Reply #24 on: July 08, 2016, 15:19:29 pm »
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

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.10 PHP 7.0.33
Testing VM 3.5.0.10097 on Joomla 3.9.10

OliviaH

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #25 on: July 08, 2016, 15:26:53 pm »
I did actually thank him for his help:
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:
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3955
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom Field checkbox to add free sample
« Reply #26 on: July 09, 2016, 01:25:41 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #27 on: July 11, 2016, 10:04:32 am »
Where my questions not specific enough??

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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3955
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom Field checkbox to add free sample
« Reply #28 on: July 11, 2016, 10:49:49 am »
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

  • Beginner
  • *
  • Posts: 40
Re: Custom Field checkbox to add free sample
« Reply #29 on: July 11, 2016, 10:59:08 am »
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.