Zen Cart Logo

DUAL Pricing v2

Views: 363,318

Results 221 to 240 of 1,504
1 Jun 2008, 2:18 PM
#221
andre avatar

andre

New Zenner

Join Date:
Sep 2004
Posts:
12
Plugin Contributions:
0

DUAL Pricing v2

madfastride:

Andre,

You might try checking that this file is correctly updated in your site. It could be an FTP error that it didn't load onto your server correctly or something similar. Let me know if your having more troubles.

admin/inlcudes/modules/product/collect_info.php

Uploaded the files one by one and its working now .

Thanx !!!

2 Jun 2008, 11:12 AM
#222
timbo77 avatar

timbo77

New Zenner

Join Date:
Jun 2008
Posts:
3
Plugin Contributions:
0

Re: DUAL Pricing v2

Can someone please tell me were I'm to insert

ALTER TABLE customers ADD customers_whole VARCHAR( 4 ) DEFAULT '0' NOT NULL;
ALTER TABLE products ADD products_price_w VARCHAR( 150 ) DEFAULT '0' AFTER products_price;
ALTER TABLE products_attributes ADD options_values_price_w VARCHAR( 150 ) DEFAULT '0' AFTER options_values_price;

in the sqlpatch to make this work and if I'm suppose to copy the files admin & includes into the admin file or into the directory

I am totally lost with this I thought it was straight forward but I guess not for me

Thank you

2 Jun 2008, 4:22 PM
#223
madfastride avatar

madfastride

Zen Follower

Join Date:
Feb 2007
Location:
Earth
Posts:
115
Plugin Contributions:
0

Re: DUAL Pricing v2

timbo77:

Can someone please tell me were I'm to insert

ALTER TABLE customers ADD customers_whole VARCHAR( 4 ) DEFAULT '0' NOT NULL;
ALTER TABLE products ADD products_price_w VARCHAR( 150 ) DEFAULT '0' AFTER products_price;
ALTER TABLE products_attributes ADD options_values_price_w VARCHAR( 150 ) DEFAULT '0' AFTER options_values_price;

in the sqlpatch to make this work and if I'm suppose to copy the files admin & includes into the admin file or into the directory

I am totally lost with this I thought it was straight forward but I guess not for me

Thank you

No problem. In your admin panel navigate to Tools > Install SQL Patches. Copy and paste the patch into the text box then click on "Send" This will update your DB. Please remember that when your updating your site and DB it's good practice to make back ups of both. Especially your DB.

6 Jun 2008, 1:40 AM
#224
madfastride avatar

madfastride

Zen Follower

Join Date:
Feb 2007
Location:
Earth
Posts:
115
Plugin Contributions:
0

Re: DUAL Pricing v2

slowawake:

I can't get this code to work. Tried inserting it in tpl_product_info_display to simply output a message -- echo("you are wholesale!"); in place of "CODE YOU WANT..." and it breaks the page.

It should work anywhere in the code right? Anyone get this to work?

My bad... sorry I forgot something very basic. To work with this code you need to declare $db a global var within your function do this by adding $db to the end of the list of var declared global or adding

global $db
```as the first line of your function.  Or you might need to change ```php
$db -> Execute( 

to

$this -> Execute(

This will also depend on how the classes and functions are set up if you don't understand Object oriented programming trial and error should suffice as these are the only two options. :)

6 Jun 2008, 3:14 PM
#225
cosmocanuck avatar

cosmocanuck

New Zenner

Join Date:
Jun 2006
Posts:
85
Plugin Contributions:
0

Re: DUAL Pricing v2

Hi! I installed DP 1.3.2 but am getting this message when I view my cart:

Fatal error: Call to undefined function zen_get_products_display_retail_net_price() in /home/unnacoco/public_html/includes/templates/free_red/templates/tpl_product_info_display.php on line 103

(I switch back to the old tpl_product_info_display.php and I'm fine, but of course I don't see the wholesale price.)

Everything else works - I can add the wholesale price(s), set user access levels, my test of a wholesale price shows up in the product listing in admin, everything but the display in the cart.

I am running ZC 1.3.7 - and I see now that this version of DP is for 1.3.8. Is this the problem? If so, must I (groan) reinstall the whole thing or can I just replace or modify one or two files to get it working?

Many thanks!
Adam

9 Jun 2008, 5:45 PM
#226
takedigital avatar

takedigital

New Zenner

Join Date:
May 2008
Posts:
16
Plugin Contributions:
0

Re: DUAL Pricing v2

Here Dual Pricing and i am having the following errors

products_id']) ) { if ($val > 0) { $adjust_max = false; $prodId = $key; $qty = $val; $add_max = zen_get_products_quantity_order_max($prodId); $cart_qty = $this->in_cart_mixed($prodId); // $new_qty = $qty; //echo 'I SEE actionMultipleAddProduct: ' . $prodId . '
'; $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart'); if (($add_max == 1 and $cart_qty == 1)) { // do not add $adjust_max= 'true'; } else { // adjust quantity if needed if (($new_qty + $cart_qty > $add_max) and $add_max != 0) { $adjust_max= 'true'; $new_qty = $add_max - $cart_qty; } $this->add_cart($prodId, $this->get_quantity($prodId)+($new_qty)); } if ($adjust_max == 'true') { // $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' C: - ' . zen_get_products_name($prodId), 'caution'); $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution'); } } } // display message if all is good and not on shopping_cart page if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) { $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success'); } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } } /** * Method to handle cart Action - notify * * @param string forward destination * @param url parameters */ function actionNotify($goto, $parameters) { global $db; if ($_SESSION['customer_id']) { if (isset($_GET['products_id'])) { $notify = $_GET['products_id']; } elseif (isset($_GET['notify'])) { $notify = $_GET['notify']; } elseif (isset($_POST['notify'])) { $notify = $_POST['notify']; } else { zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page')))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $check_query = "select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $check = $db->Execute($check_query); if ($check->fields['count'] < 1) { $sql = "insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $_SESSION['customer_id'] . "', now())"; $db->Execute($sql); } } // zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'notify', 'main_page')))); zen_redirect(zen_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, zen_get_all_get_params(array('action', 'notify', 'main_page')))); } else { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } /** * Method to handle cart Action - notify remove * * @param string forward destination * @param url parameters */ function actionNotifyRemove($goto, $parameters) { global $db; if ($_SESSION['customer_id'] && isset($_GET['products_id'])) { $check_query = "select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $check = $db->Execute($check_query); if ($check->fields['count'] > 0) { $sql = "delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'"; $db->Execute($sql); } zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'main_page')))); } else { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } /** * Method to handle cart Action - Customer Order * * @param string forward destination * @param url parameters */ function actionCustomerOrder($goto, $parameters) { global $zco_page; global $messageStack; if ($_SESSION['customer_id'] && isset($_GET['pid'])) { if (zen_has_product_attributes($_GET['pid'])) { zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid'])); } else { $this->add_cart($_GET['pid'], $this->get_quantity($_GET['pid'])+1); } } // display message if all is good and not on shopping_cart page if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) { $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success'); } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - remove product * * @param string forward destination * @param url parameters */ function actionRemoveProduct($goto, $parameters) { if (isset($_GET['product_id']) && zen_not_null($_GET['product_id'])) $this->remove($_GET['product_id']); zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } /** * Method to handle cart Action - user action * * @param string forward destination * @param url parameters */ function actionCartUserAction($goto, $parameters) { $this->notify('NOTIFY_CART_USER_ACTION'); } // $qty = $this->adjust_quantity($qty, (int)$products_id, 'shopping_cart'); // temporary fixed on messagestack used for check and message needs better separation function adjust_quantity($check_qty, $products, $message=false) { global $messageStack; $old_quantity = $check_qty; if (QUANTITY_DECIMALS != 0) { // $new_qty = round($new_qty, QUANTITY_DECIMALS); $fix_qty = $check_qty; switch (true) { case (!strstr($fix_qty, '.')): $new_qty = $fix_qty; // $messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution'); break; default: $new_qty = preg_replace('/[0]+$/','', $check_qty); // $messageStack->add_session('shopping_cart', 'A: ' . ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ' - ' . $old_quantity . ' => ' . $new_qty, 'caution'); break; } } else { if ($check_qty != round($check_qty, QUANTITY_DECIMALS)) { $new_qty = round($check_qty, QUANTITY_DECIMALS); $messageStack->add_session('shopping_cart', ERROR_QUANTITY_ADJUSTED . zen_get_products_name($products) . ERROR_QUANTITY_CHANGED_FROM . $old_quantity . ERROR_QUANTITY_CHANGED_TO . $new_qty, 'caution'); } else { $new_qty = $check_qty; } } return $new_qty; } } ?> 
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/wealthuk/public_html/includes/classes/shopping_cart.php:1903) in /home/wealthuk/public_html/includes/functions/sessions.php on line 108

Warning: Cannot modify header information - headers already sent by (output started at /home/wealthuk/public_html/includes/classes/shopping_cart.php:1903) in /home/wealthuk/public_html/admin/includes/init_includes/init_templates.php on line 32

Here my website
http://www.joanne-warrick.com

10 Jun 2008, 2:51 AM
#227
cosmocanuck avatar

cosmocanuck

New Zenner

Join Date:
Jun 2006
Posts:
85
Plugin Contributions:
0

Re: DUAL Pricing v2

Following up on my question above (and still hopefully looking forward to an answer!)... I am wondering something:

If I'm running ZenCart 1.3.7, should I install a previous version of Dual Pricing? If so, which one? And would I be missing out on important bug fixes if I do that?

Thanks,
Adam

10 Jun 2008, 3:58 PM
#229
cosmocanuck avatar

cosmocanuck

New Zenner

Join Date:
Jun 2006
Posts:
85
Plugin Contributions:
0

Re: DUAL Pricing v2

Problem solved - it was as simple as installing the correct version of Dual Pricing - for ZC 1.3.7!

Truly, it pays to read everything, and to install the appropriate plugin for one's version of ZC.

Thanks!
adam

18 Jun 2008, 7:48 PM
#230
semaxd avatar

semaxd

New Zenner

Join Date:
May 2008
Location:
Ventura Co.
Posts:
82
Plugin Contributions:
1

Re: DUAL Pricing v2

**So i read through this whole thread and it kinda looks like dual pricing will work for me, but can you clarify that it will do what I need?......

here goes

We sell dvds in this store. We are selling to wholesalers and distributors on this site. Another cart is not an option, unfortunatly the company owner wants it only on one.

I need wholesale pricing to be 12.00 for new products and 10.00 for older titles.
I need distributor pricing to be 15.00 for new products and 13.00 for older titles.

The products are the same for both cust types.

If dual pricing will work cool. if not, any idea what I should i use?

Thanks for any help here,
jim**

18 Jun 2008, 10:07 PM
#231
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: DUAL Pricing v2

semaxd:

**So i read through this whole thread and it kinda looks like dual pricing will work for me, but can you clarify that it will do what I need?......

here goes

We sell dvds in this store. We are selling to wholesalers and distributors on this site. Another cart is not an option, unfortunatly the company owner wants it only on one.

I need wholesale pricing to be 12.00 for new products and 10.00 for older titles.
I need distributor pricing to be 15.00 for new products and 13.00 for older titles.

The products are the same for both cust types.

If dual pricing will work cool. if not, any idea what I should i use?

Thanks for any help here,
jim**

Hi Jim,

Dual Pricing would work like this.....

No Country For Old Men
Price: 15.00
Wholesale: 12.00-0.00-0.00-0.00

The Breakfast Club
Price 13.00
Wholesale: 10.00-0.00-0.00-0.00

Then you would assign a "1" to all of the wholesale customers for their pricing level in Admin>Customers. When they are logged in.... their wholesale price will magically appear. Yay!

Since Dual pricing uses up to four pricing levels, I put 0.00 into the other spaces. This probably doesn't have to be done, but I've always done it this way and never had any problems (and never tried it without the zeros).

So yes, Dual Pricing should work for you. You can also use the Quick Updates mod, enable it to work with Dual Pricing, and you can update all of your prices much faster.

18 Jun 2008, 10:11 PM
#232
semaxd avatar

semaxd

New Zenner

Join Date:
May 2008
Location:
Ventura Co.
Posts:
82
Plugin Contributions:
1

Re: DUAL Pricing v2

nice! thanks that what i needed to know!!:clap::clap:

18 Jun 2008, 11:04 PM
#233
semaxd avatar

semaxd

New Zenner

Join Date:
May 2008
Location:
Ventura Co.
Posts:
82
Plugin Contributions:
1

Re: DUAL Pricing v2

craft,

It works like a charm thanks again!!
jim

20 Jun 2008, 6:21 PM
#234
madfastride avatar

madfastride

Zen Follower

Join Date:
Feb 2007
Location:
Earth
Posts:
115
Plugin Contributions:
0

Re: DUAL Pricing v2

craftzombie:

I put 0.00 into the other spaces. This probably doesn't have to be done, but I've always done it this way and never had any problems (and never tried it without the zeros).

Craftzombie,

As someone who hates to type anything extra, you can leave out the other zeroes if you want. :wink:

Cheers

20 Jun 2008, 8:18 PM
#235
craftzombie avatar

craftzombie

Zen Follower

Join Date:
Jul 2006
Posts:
494
Plugin Contributions:
0

Re: DUAL Pricing v2

madfastride:

Craftzombie,

As someone who hates to type anything extra, you can leave out the other zeroes if you want. :wink:

Cheers

Thanks! Originally I had 4 levels, but when I went to 1 level, I just put the zeros. Since I copied and pasted all of this with Quick Updates, it was no biggie. :smile:

22 Jun 2008, 10:42 AM
#236
djjase avatar

djjase

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: DUAL Pricing v2

Hi Great mod, just 2 questions:

(1) How would I show both prices for both logged in and not logged in?

(2) How do you get it to show the retail price as taxed and the wholesale as not taxed?

I am setting up an Australian shop where we have to show GST prices - This script would work great where I can use "retail" as "GST" and "wholesale" as "No GST".
But I need to be able to display both all the time - either logged in or not.

Thanks for your help.

23 Jun 2008, 5:32 AM
#237
madfastride avatar

madfastride

Zen Follower

Join Date:
Feb 2007
Location:
Earth
Posts:
115
Plugin Contributions:
0

Re: DUAL Pricing v2

Just walk through every file and anytime you see a note mentioning the code has been changed for dual pricing then remove these "if" statements;

 if ($_SESSION['customer_id'])
``````php
if ($customer_check->fields['customers_whole'] != "0")
```Also get rid of any functions that may be executed just to gather data for an "if" statement.  Some basic PHP skills or trial and error will be needed in order to remove the right code with the corresponding functions.

For example... 

```php
//***********************************************************************
//***DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
if ($_SESSION['customer_id']) {
  $customers_id = $_SESSION['customer_id'];
    $customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
 if ($customer_check->fields['customers_whole'] != "0") { 
     echo '<span id="retailwhole">' . ' Retail Price: '.$one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == '1') ? TEXT_BASE_PRICE : '') . zen_get_products_display_retail_net_price((int)$_GET['products_id']).'</span><br /> ';
 }
}
//***********************************************************************
//***END DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
```Above (taken from tpl_product_info_display.php, line 67-75) will now look like this...

```php
//***********************************************************************
//***DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
 
     echo '<span id="retailwhole">' . ' Retail Price: '.$one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == '1') ? TEXT_BASE_PRICE : '') . zen_get_products_display_retail_net_price((int)$_GET['products_id']).'</span><br /> ';

//***********************************************************************
//***END DISPLAY NET RETAIL PRICE IF WHOLESALE CUSTOMER IS LOGGED ON
//***********************************************************************
```Next you can just edit the tpl_product_info_display.php file in order to change the wording to suit your needs.
24 Jun 2008, 7:46 AM
#238
louis avatar

louis

Zen Follower

Join Date:
Jul 2006
Location:
Johannesburg
Posts:
408
Plugin Contributions:
0

Re: DUAL Pricing v2

Sorry if this has been answered before. I read most of the posts and also did a search but cannot find a post related to my problem.

I am using dual pricing but on entering multiple prices on the product information screen (as per the example 50.00-30.00-0.00-25.00) only the first price is actually stored. When entering the product page again the wholesale field contains only 50.00

Any ideas?

Zencart 1.3.8a with dual pricing version 1.3.2

24 Jun 2008, 8:55 AM
#239
louis avatar

louis

Zen Follower

Join Date:
Jul 2006
Location:
Johannesburg
Posts:
408
Plugin Contributions:
0

Re: DUAL Pricing v2

Louis:

When entering the product page again the wholesale field contains only 50.00

Not to worry, the field definition in the DB was wrong. I must have added it at some point in the past and did not change it to varchar when I added the dual pricing mod.:blush:

27 Jun 2008, 6:54 PM
#240
tamara avatar

tamara

New Zenner

Join Date:
Jun 2008
Location:
Waupun, Wisconsin
Posts:
3
Plugin Contributions:
0

Re: DUAL Pricing v2

I've just downloaded this mod and I had a question that I don't think has been asked yet, or maybe I missed it in my searching. In that case, I apologize.

The ReadMe.txt states "Making these changes WILL make upgrading your store to new versions harder."

I've been working with Zen Cart for 2 years now and, although I love it and am grateful, I sure don't want to add any trouble. Question is: Can I install this mod taking advantage of the override system as with customization files?

For example:

File 'admin/attributes_controller.php' appears to be overwritten upon install.

Instead of overwriting, can I place the new file in 'admin/CUSTOM/attributes_controller.php' ?

Thank you for any insight into this question.

Tamara