If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Minimun price per category or per manufacturer

Minimun price per category or per manufacturer

Locked

Started by articulosdebelleza on 29 May 2009, 2:08 PM · Views: 1,001

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
29 May 2009, 2:08 PM
#1
articulosdebelleza avatar

articulosdebelleza

New Zenner

Join Date:
May 2009
Posts:
1
Plugin Contributions:
0

Minimun price per category or per manufacturer

Hi I am using the latest Zencart, I am very close to finish the site but can't resolve this.

I need that the zen-cart have a minimum price PER CATEGORY or PER MANUFACTURER, because my categories are the name of the manufacturers.

Actually I'm using the module Minimum Order from http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=599

But this module only allows to put a minimum price for the order total. I thought long ways to avoid need this but isn't possible, so I decided to create the module or modify the module "Minimum Order".

Can you help me?

I think that to modify the module Minimum Order i will have to modify the file class.minimum_order_amount.php :

<?php
/**
 * class.minimum_order_amount.php
 *
 * @copyright Copyright 2005-2007 Andrew Berezin eCommerce-Service.com
 * @copyright Portions Copyright 2003-2006 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: config.minimum_order_amount.php 1.0.1 20.09.2007 0:06 AndrewBerezin $
 */

/**
 * Observer class used to check minimum order amount
 *
 */
class minimum_order_amount extends base {
  /**
   * constructor method
   *
   * Attaches our class to the ... and watches for 4 notifier events.
   */
  function minimum_order_amount() {
    global $zco_notifier;
//      $_SESSION['cart']->attach($this, array('NOTIFIER_CART_GET_PRODUCTS_START', 'NOTIFIER_CART_GET_PRODUCTS_END'));
    $zco_notifier->attach($this, array('NOTIFY_HEADER_END_SHOPPING_CART', 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING', 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT', 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION'));
  }
  /**
   * Update Method
   *
   * Called by observed class when any of our notifiable events occur
   *
   * @param object $class
   * @param string $eventID
   */
  function update(&$class, $eventID) {
    global $messageStack;
    global $currencies;
    switch ($eventID) {
      case 'NOTIFIER_CART_GET_PRODUCTS_END':
      case 'NOTIFY_HEADER_END_SHOPPING_CART':
        if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
            $_SESSION['valid_to_checkout'] = false;
            $messageStack->add('shopping_cart', sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)) . '<br />', 'caution');
          }
        }
        break;
      case 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING':
      case 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT':
      case 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION':
        if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
          }
        }
        break;
      default:
        break;
    }
  }
}
?>

Really I don't know what to do after this. I really would appreciate your help.

Sorry for my english, i'm from Argentina.

PD: If the moderators think that the post isn't in the right place please move it to the correct place.

26 Oct 2010, 9:03 AM
#2
balaji avatar

balaji

New Zenner

Join Date:
Nov 2009
Location:
Chennai, India
Posts:
50
Plugin Contributions:
0

Re: Minimun price per category or per manufacturer

Have you found a solution for it?

Balaji R