Post by bgsman » Sat May 28, 2011 10:54 pm

Like many of us using OC we have products set up with Discounts in Dollars when a customer buys a certain quantity. I like to run "Specials" and drop the reg price so it shows up in the storefront with the reg priced "Striked out" and the "Special Price" in Red. Makes it look like something special.

The problem lies in the fact that if I have a quantity buy of 3 set in the "Discount Price" and it is higher than the "Special Price" then the price will go up to the buy 3 price when the quantity hits that number and the customer doesn't get the "Special Price".

Having a Discount as Percentage(rather than $$$$) the cart should be able to read the Reg Price...or special price(if set)...then reduce buy an additional percentage if the quantity is met.

As far as I can see it would only take one change to make the entry on the Product Discount Tab be able to accept "a percentage off" rather than only a price in dollars.

Any chance of that going into v1.5 ?

User avatar
Newbie

Posts

Joined
Tue May 10, 2011 3:55 am

Post by Qphoria » Sun May 29, 2011 1:03 am

+1

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bgsman » Sun May 29, 2011 1:53 am

Forgot to say in initial post that I am using v 1.4.9.4

@Qphoria: Don't understand what your response means "+1" ???

User avatar
Newbie

Posts

Joined
Tue May 10, 2011 3:55 am

Post by webpie it. » Sun May 29, 2011 2:46 am

I think he means it could go into V 1.5.1

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by Qphoria » Sun May 29, 2011 2:54 am

Eh.. no. I should start giving internet classes.

+1 on a forum means "me too" or "i want this too" or "i agree"

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tdaubs » Fri Mar 23, 2012 6:38 am

Are there any extensions that provide this functionality?

Image
Opencart Support . Buy Me a Coffee?


User avatar
Active Member

Posts

Joined
Fri Apr 08, 2011 4:51 am
Location - Southern California

Post by bill_p » Mon Mar 26, 2012 9:25 pm

+1 (1.5.2.1)

Newbie

Posts

Joined
Mon Mar 26, 2012 9:24 pm

Post by straightlight » Tue Mar 27, 2012 4:49 am


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 bill_p » Thu Mar 29, 2012 3:27 am

straightlight - I appreciate your contribution for the discount percentage.
However, it has some problems:
1 - the first time adding a discount, the percentage field is a normal field and not the dropdown.
2 - it does not save the values entered.
3 - when you attempt to update the discount, the dropdown is there but it still does not save the value selected.
4 - if I edit the discount with phpadmin and enter a discount amount, the percentage is applied correctly to the products.
5 - If I attempt to update the discount and add an additional group, it resets the percentages to "1".

I am using OC 1.5.2.1

Bill

Newbie

Posts

Joined
Mon Mar 26, 2012 9:24 pm

Post by straightlight » Thu Mar 29, 2012 3:33 am

Looks like a small typo from the admin/model/catalog/product.php file under my XML when I replaced the line. Otherwise, regarding your describe problem above with PHPMyAdmin, I was able to enter a value myself from the console and seem to save correctly, indeed. I will look into that line and post an update.

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 straightlight » Thu Mar 29, 2012 8:19 am

Since I was able to reproduce this problem from the models within the XML and unresponsive to those lines without having any line conflicts with other XML files, here's an alternative solution:

From the XML, replace:

Code: Select all

<!--<file name="admin/model/catalog/product.php">
		<operation>
			<search position="replace" index="1"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");]]></search>
			<add><![CDATA[
			$this->db->query("INSERT INTO `" . DB_PREFIX . "product_discount` SET `product_id` = '" . (int)$product_id . "', `customer_group_id` = '" . (int)$product_discount['customer_group_id'] . "', `quantity` = '" . (int)$product_discount['quantity'] . "', `priority` = '" . (int)$product_discount['priority'] . "', `percentage` = '" . (int)$product_discount['percentage'] . "', `date_start` = '" . $this->db->escape($product_discount['date_start']) . "', `date_end` = '" . $this->db->escape($product_discount['date_end']) . "'");
			]]>
			</add>
		</operation>
		
		<operation>
			<search position="replace" index="2"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");]]></search>
			<add><![CDATA[			
			$this->db->query("INSERT INTO `" . DB_PREFIX . "product_discount` SET `product_id` = '" . (int)$product_id . "', `customer_group_id` = '" . (int)$product_discount['customer_group_id'] . "', `quantity` = '" . (int)$product_discount['quantity'] . "', `priority` = '" . (int)$product_discount['priority'] . "', `percentage` = '" . (int)$product_discount['percentage'] . "', `date_start` = '" . $this->db->escape($product_discount['date_start']) . "', `date_end` = '" . $this->db->escape($product_discount['date_end']) . "'");
			]]>
			</add>
		</operation>
with:

Code: Select all

<!--<file name="admin/model/catalog/product.php">
		<operation>
			<search position="replace" index="1"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");]]></search>
			<add><![CDATA[
			$this->db->query("INSERT INTO `" . DB_PREFIX . "product_discount` SET `product_id` = '" . (int)$product_id . "', `customer_group_id` = '" . (int)$product_discount['customer_group_id'] . "', `quantity` = '" . (int)$product_discount['quantity'] . "', `priority` = '" . (int)$product_discount['priority'] . "', `percentage` = '" . (int)$product_discount['percentage'] . "', `date_start` = '" . $this->db->escape($product_discount['date_start']) . "', `date_end` = '" . $this->db->escape($product_discount['date_end']) . "'");
			]]>
			</add>
		</operation>
		
		<operation>
			<!--<search position="replace" index="2"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");]]></search>
			<add><![CDATA[			
			$this->db->query("INSERT INTO `" . DB_PREFIX . "product_discount` SET `product_id` = '" . (int)$product_id . "', `customer_group_id` = '" . (int)$product_discount['customer_group_id'] . "', `quantity` = '" . (int)$product_discount['quantity'] . "', `priority` = '" . (int)$product_discount['priority'] . "', `percentage` = '" . (int)$product_discount['percentage'] . "', `date_start` = '" . $this->db->escape($product_discount['date_start']) . "', `date_end` = '" . $this->db->escape($product_discount['date_end']) . "'");
			]]>
			</add>
		</operation>-->
In admin/model/catalog/product.php file,

replace (twice the same lines):

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");
with:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', `percentage` = '" . (int)$product_discount['percentage'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");
I was, then, able to see the results on the form. Now trying to figure out why these lines would be denied from XML.

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 bill_p » Sun Apr 01, 2012 8:48 pm

straightlight - will you be posting the updated files once you have completed your mods?

Newbie

Posts

Joined
Mon Mar 26, 2012 9:24 pm

Post by rmi » Sun Apr 01, 2012 10:01 pm

Anyone have solution for 1.4.9.x??

rmi
New member

Posts

Joined
Tue Nov 09, 2010 3:13 am

Post by chrtho » Sun Apr 08, 2012 4:26 pm

This looks great, but I cant get it to work...
Using the latest version v.1.5.2.1
straightlight wrote:Since I was able to reproduce this problem from the models within the XML and unresponsive to those lines without having any line conflicts with other XML files, here's an alternative solution:

From the XML, replace:
...
I cant find this lines in the XML-file downloaded. Yes, I do see something similar, but not exactly...

Is this plugin available for v.1.5.2.1?
What else might I misunderstand??
Thx

Newbie

Posts

Joined
Sun Apr 08, 2012 4:23 pm

Post by neatpleats » Sun Apr 22, 2012 12:38 am

Has anyone got this mod to work correctly?
Scott

Neat Pleats Lamps & home decor since 1993.


User avatar
New member

Posts

Joined
Mon May 17, 2010 7:29 pm
Location - Baltimore, MD

Post by bill_p » Wed Jun 06, 2012 11:04 pm

I REALLY, REALLY wish someone would develop this feature.

Newbie

Posts

Joined
Mon Mar 26, 2012 9:24 pm

Post by storm-cloud » Fri Oct 09, 2015 7:26 am

Excuse me for digging up this old thread but I also require this.

To clarify, I am not looking for a modification that will simply calculate the special/discount based on a percentage on the fly, I would like to enter a percentage and this will be applied to the product permanently, including product options.

If I enter a discount of 10%, then this should apply to the main product and also the product options as a percentage. If I am correct, this should also mean that this can be applied to customer groups with the discount being visible on the product and product options immediately, while they are shopping and not only at checkout (like many other extensions provide).

Would anyone know how to achieve this or an existing extension that will provide this?

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by straightlight » Tue Oct 13, 2015 6:37 am

storm-cloud wrote:Excuse me for digging up this old thread but I also require this.

To clarify, I am not looking for a modification that will simply calculate the special/discount based on a percentage on the fly, I would like to enter a percentage and this will be applied to the product permanently, including product options.

If I enter a discount of 10%, then this should apply to the main product and also the product options as a percentage. If I am correct, this should also mean that this can be applied to customer groups with the discount being visible on the product and product options immediately, while they are shopping and not only at checkout (like many other extensions provide).

Would anyone know how to achieve this or an existing extension that will provide this?
Try my contribution: http://forum.opencart.com/viewtopic.php?f=123&t=152887

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 Johnathan » Tue Oct 13, 2015 10:57 pm

Bulk Product Editing can do this for Specials/Discounts, where you enter a percentage and it calculates the appropriate flat value, but it doesn't work with options. Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by straightlight » Wed Oct 14, 2015 12:07 am

Added Product Options to discount total calculation on my contribution. Documentation on the market updated.

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
Who is online

Users browsing this forum: No registered users and 4 guests