Hi,

This patch for the 6.x branch allow to display a description of a discount on the product page.

This patch only apply on the latest bazaar version of the Ubercart 6.x branch, cause it depend on the core modification about product fields administration page (more details here).

So ATM, it couldn't be backported until the 5.x branch of ubercart get this core improvement too.

So, basically, it add a discount line in admin/store/settings/products/edit/fields, if enabled, it display matching discount description into the node.

To do that, I had to alter the return value of uc_discounts_product_discount_price(). Instead of returning a value, it return an array that is interpreted in the nodeapi function. I think it's a good thing for extensibility and this is a first step to make this module work with attributes too..

Here is the patch

Comments

zmove’s picture

error in the patch, wait a little moment for another commit

zmove’s picture

StatusFileSize
new4.87 KB

should work now

psynaptic’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
zmove’s picture

I committed it on the latest 6.x dev version. I added the description entry to the discount array that is associated to a product. So you can access a discount description like that :

  foreach($node->discounts as $discount) {
    drupal_set_message('<pre>'.print_r($discount['description'], true).'</pre>');
  }
zmove’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.