Post by reed17 » Tue Aug 09, 2016 10:37 pm

Hi everyone. I purchased a module and have it installed. Through trouble shooting I determined it isn't completely working because it is using the outdated (im on 2.1.0.2) $this->session-data['cart'] session variable to gather information from the cart. Obviously as of 2.x this is no longer stored in a session variable and rather available via the getProducts() function.

However, with all my luck, and to no avail, I have not been able to succesfully "2.x-ify" this piece of code. I have had little to no luck with the developer (as he believes it's not his code, even though i've had to fix pieces of it) and from prior searches for help it appears the developer might do some shady things if provided access to the website.

So, if at all possible could I receive some help? file is system/library/cart.php

Code: Select all

$offer_discount_quantity = 0;

		foreach ($this->session->data['cart'] as $key_offer => $quantity_offer) {
			$product_offer = (array)unserialize(base64_decode($key_offer));

			if ($product_offer['product_id'] == $product_id) {
			$offer_discount_quantity += $quantity_offer;
			}
		}

		$offer_discount_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "offer_discount WHERE product_id = '" . (int)$product_id . "' AND customer_id = '" . (int)$this->customer->getId()  . "' AND  quantity <= '" . (int)$offer_discount_quantity . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity DESC, price ASC LIMIT 1");
basically it changes the price of a product if it exists in the module. Everything works up until this point and it never enters the foreach loop, hence never setting product_id, hence never making the query truly work.

The errors are these:
2016-08-09 9:36:33 - PHP Notice: Undefined index: cart in <omitted>.../vq2-system_library_cart.php on line 173
2016-08-09 9:36:33 - PHP Warning: Invalid argument supplied for foreach() in <omitted>.../vq2-system_library_cart.php on line 173
2016-08-09 9:36:33 - PHP Notice: Undefined variable: product_id in <omitted>.../vq2-system_library_cart.php on line 181
please note: i will not pay for help on this. I already dropped nearly 200 dollars for a module that needed debugging and fixes already. This is just a small piece of the puzzle and unfortunately the last piece.
Last edited by straightlight on Wed Aug 10, 2016 5:11 am, edited 1 time in total.
Reason: Added quote tags.

New member

Posts

Joined
Thu Mar 17, 2016 2:07 am

Post by straightlight » Wed Aug 10, 2016 5:13 am

Hi everyone. I purchased a module and have it installed.
please note: i will not pay for help on this. I already dropped nearly 200 dollars for a module that needed debugging and fixes already. This is just a small piece of the puzzle and unfortunately the last piece.
Hi reed17,

could you post the link of the extension you are referring to specifically?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by reed17 » Wed Aug 10, 2016 11:17 am

i'd rather not post it publicly, as im not entirely sure it is the developer. i pmed you

New member

Posts

Joined
Thu Mar 17, 2016 2:07 am

Post by straightlight » Wed Aug 10, 2016 6:29 pm

Based on what you reported over PM, I would suggest to contact the Opencart site support team by also providing your order ID in order for them to action a ticket: http://www.opencart.com/index.php?route=support/contact

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by reed17 » Wed Aug 10, 2016 10:20 pm

sadly since it was a special request I paid directly via paypal. Of course I can file a dispute and get a refund. however, I think realistically i'll just ask for the difference between the module and the extra work.

what type of ticket should i submit? i see support, refund, marketing, and other business. is this to report the seller or report the transaction?

let me know.

New member

Posts

Joined
Thu Mar 17, 2016 2:07 am

Post by reed17 » Wed Aug 10, 2016 11:48 pm

on another note. has anyone been able to help with or visualize the fix for the code?

basically it needs to check the cart to see if a product id exists that also exists in this module. I need it to run a foreach loop through the cart and set productid/values and run a query.

New member

Posts

Joined
Thu Mar 17, 2016 2:07 am
Who is online

Users browsing this forum: No registered users and 3 guests