Results 1 to 2 of 2

Salemaker

This is a discussion on Salemaker within the osCMax v1.7 General Mods Discussion forums, part of the osCmax v1.7 Forums category; Ive tried this module for ms2.2 converting to max version http://www.oscommerce.com/community/...arch,salemaker This is what I found The admin section installs ...

      
  1. #1
    Anonymous
    Guest


    Default Salemaker

    Ive tried this module for ms2.2 converting to max version

    http://www.oscommerce.com/community/...arch,salemaker

    This is what I found

    The admin section installs great

    There are 3 files in the catalog thats would need tuning because max has
    SPC special price per customer installed.

    These are the files

    catalog\includes\functions\general.php

    catalog\includes\classes\shopping_cart.php

    catalog\includes\boxes\specials.php

    2 off these need a bit of work
    Example with the SPC in Max verions catalog\includes\functions\general.php
    ===============================
    // TABLES: products
    function tep_get_products_special_price($product_id) {
    //Begin SPC
    global $customer_id;

    $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
    $customer_group = tep_db_fetch_array($customer_group_query);
    //End SPC

    //Begin SPC
    // $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status");
    $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status and customers_group_id = ". (int)$customer_group['customers_group_id']);
    //End SPC

    $product = tep_db_fetch_array($product_query);

    return $product['specials_new_products_price'];
    }
    ========================
    The original MS2.2 would have been
    =======================
    // TABLES: products
    function tep_get_products_special_price($product_id) {
    $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and status");
    $product = tep_db_fetch_array($product_query);

    return $product['specials_new_products_price'];
    }
    ===============================
    would need merging Salemaker changes with below
    ===============================
    // TABLES: products
    function tep_get_products_special_price($product_id) {
    $product_query = tep_db_query("select products_price, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $product_id . "'");
    if (tep_db_num_rows($product_query)) {
    $product = tep_db_fetch_array($product_query);
    $product_price = $product['products_price'];
    } else {
    return false;
    }

    $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and status");
    if (tep_db_num_rows($specials_query)) {
    $special = tep_db_fetch_array($specials_query);
    $special_price = $special['specials_new_products_price'];
    } else {
    $special_price = false;
    }

    if(substr($product['products_model'], 0, 4) == 'GIFT') { //Never apply a salededuction to Ian Wilson's Giftvouchers
    return $special_price;
    }

    $product_to_categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_id . "'");
    $product_to_categories = tep_db_fetch_array($product_to_categories_query);
    $category = $product_to_categories['categories_id'];

    $sale_query = tep_db_query("select sale_specials_condition, sale_deduction_value, sale_deduction_type from " . TABLE_SALEMAKER_SALES . " where sale_categories_all like '%," . $category . ",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0000-00-00') and (sale_date_end >= now() or sale_date_end = '0000-00-00') and (sale_pricerange_from <= '" . $product_price . "' or sale_pricerange_from = '0') and (sale_pricerange_to >= '" . $product_price . "' or sale_pricerange_to = '0')");
    if (tep_db_num_rows($sale_query)) {
    $sale = tep_db_fetch_array($sale_query);
    } else {
    return $special_price;
    }

    if (!$special_price) {
    $tmp_special_price = $product_price;
    } else {
    $tmp_special_price = $special_price;
    }

    switch ($sale['sale_deduction_type']) {
    case 0:
    $sale_product_price = $product_price - $sale['sale_deduction_value'];
    $sale_special_price = $tmp_special_price - $sale['sale_deduction_value'];
    break;
    case 1:
    $sale_product_price = $product_price - (($product_price * $sale['sale_deduction_value']) / 100);
    $sale_special_price = $tmp_special_price - (($tmp_special_price * $sale['sale_deduction_value']) / 100);
    break;
    case 2:
    $sale_product_price = $sale['sale_deduction_value'];
    $sale_special_price = $sale['sale_deduction_value'];
    break;
    default:
    return $special_price;
    }

    if ($sale_product_price < 0) {
    $sale_product_price = 0;
    }

    if ($sale_special_price < 0) {
    $sale_special_price = 0;
    }

    if (!$special_price) {
    return number_format($sale_product_price, 4, '.', '');
    } else {
    switch($sale['sale_specials_condition']){
    case 0:
    return number_format($sale_product_price, 4, '.', '');
    break;
    case 1:
    return number_format($special_price, 4, '.', '');
    break;
    case 2:
    return number_format($sale_special_price, 4, '.', '');
    break;
    default:
    return number_format($special_price, 4, '.', '');
    }
    }
    }
    ===============================
    Anyone had any luck changing the files to work with MS2.2 Max
    Be great to get this mod working.

  2. #2
    New Member
    Join Date
    Feb 2005
    Posts
    11
    Rep Power
    0


    Default RE: Salemaker

    I used to use this contrib in onscommerce until I realized that it alters your tax settings for products. If you need to have accurate reporting of your sales tax for all products sold in a certain state, avoid salemaker in it's present condition. Otherwise, it will be on and off (salemaker and the tax collecting of products you choose to have on sale or off sale).

    Just a thought.

    d

Similar Threads

  1. anyone using Salemaker contribution?
    By MAKAVELI1980 in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 08-27-2005, 04:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •