Friday Madness

40%

Grab Discount
Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Access Shopping Cart data in PHP Script

1 month 1 week ago #1

  • Bernhard's Avatar
  • Bernhard
  • Posts: 38
Hi,

for a client project I do use Balbooa forms and need to access the shopping cart data (products, amount, tax, shipping) inside the PHP scripts of the submit button.

All other fields I can access like this - example:
$formdata = new stdClass();
$formdata->name = '[Field ID=1]';

How could I access the shopping cart data here?
Thanks for a hint

1 month 6 days ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 20435
Hello,

Thank you for contacting us!

You can use
$this->paymentData
description of properties you can find in this post
www.balbooa.com/joomla-forms-documentati...-payment-integration

Let us know if you need more assistance!

Best Regards,
Vyacheslav, Balbooa Support Team

1 month 6 days ago #3

  • Bernhard's Avatar
  • Bernhard
  • Posts: 38
Hi Vyacheslav,

thank you very much. Awesome.

Had a little trouble to print out the correct price in the list view.

Just noticed that you add 1% on the product price on line 240 of the baformsModelForm->preparePaymentData() function.
foreach ($object->products as $products) {
            foreach ($products as $product) {
                $product->price = $product->price * 1 + $product->price / 100;  // Why this??
                $product->total = $product->price * $product->quantity;
                $this->paymentData->products[] = $product;
            }
}

To get the output right I needed to subtract 1% of $product->price and $product->total.

What is the reason for this?

1 month 5 days ago #4

  • Artem's Avatar
  • Artem
  • Posts: 9399
Hi there!

Thank you for informing us!
You can delete this line, in the next Forms update, this line will be deleted too!

Regards,
Artem, Balbooa.com

2 days 8 hours ago #5

  • Bernhard's Avatar
  • Bernhard
  • Posts: 38
Hi Artem,

look like Version 2.1.1 for Joomla 4, this bug ist back (or still there)?!

Thanks for reviewing this.

Kind regards,
Bernhard

1 day 21 hours ago #6

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 20435
Hello,
Thank you for contacting us

As we understand you have updated the forms,
but no fix has been added in this version (this is the current version)

Regards,
Vyacheslav, Balbooa.com

1 day 19 hours ago #7

  • Bernhard's Avatar
  • Bernhard
  • Posts: 38
Hi Vyacheslav,

yes. Just checked another project. Updated to the 2.1.1. - The line of code is still there.

Thanks and kind regards,
Bernhard

1 day 19 hours ago #8

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 20435
Let us know if you need more assistance!

Best Regards,
Vyacheslav, Balbooa Support Team

1 day 19 hours ago #9

  • Bernhard's Avatar
  • Bernhard
  • Posts: 38
It would be great, if the line would get deleted in future updates.
/components/com_baforms/models/form.php line 240 should get removed permanentely.

Best,
Bernhard

1 day 19 hours ago #10

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 20435
We will do this in future updates.

Best Regards,
Vyacheslav, Balbooa Support Team
Powered by Kunena Forum