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?ma...roducts_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 :
Really I don't know what to do after this. I really would appreciate your help.Code:<?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; } } } ?>
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.



