Post by Qphoria » Sun Oct 19, 2008 11:16 am

Ah yes sorry. check now.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Sun Oct 19, 2008 10:55 pm

I broke the Beta
Going from checkout_confirm to checkout_process
Error:
Notice: Undefined variable: product in ...... \library\cart\order.php on line 84

I can't buy my little green motorbike  :'(

The customer order email came through though
Last edited by jty on Sun Oct 19, 2008 10:57 pm, edited 1 time in total.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Sun Oct 19, 2008 11:22 pm

Yep.
Fixed.
Thanks.
PM.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Tue Oct 21, 2008 12:33 am

We're getting there .............
I can now buy my green motor bike but the price is double
I'm not paying double price for my motor bike  >:(

Beta 2 - Prices in cart are doubled for options. Product price is fine, only options prices double
eg option price of $100 shows in cart as $200
If product price is $1 and prefix is +, then the price in cart shows up as $201 = 1+ (100 x 2)

Good night

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by jty » Tue Oct 21, 2008 2:43 am

I found it !!!! I was looking in the wrong file  >:(

It's in library/cart.php. Duplicate code line 43 - 50
Remove one lot of of this:

Code: Select all

foreach ($options as $product_to_option_id) {
        			$option = $this->database->getRow("select o.name as name, ov.name as `value`, p2o.price, p2o.prefix from product_to_option p2o left join `option` o on p2o.option_id = o.option_id left join option_value ov on p2o.option_value_id = ov.option_value_id where p2o.product_to_option_id = '" . (int)$product_to_option_id . "' and product_id = '" . (int)$product_id . "' and o.language_id = '" . (int)$this->language->getId() . "' and ov.language_id = '" . (int)$this->language->getId() . "'");

        			if ($option['prefix'] == '+') {
          				$option_price = $option_price + $option['price'];
        			} elseif ($option['prefix'] == '-') {
          				$option_price = $option_price - $option['price'];
        			}

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Tue Oct 21, 2008 2:48 am

Yep. I really shouldn't be allowed to use Copy/Paste.  :-X
Fixed. but you already got it too.
Thanks!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Sat Nov 29, 2008 12:01 am

\Option_Weight_n_Stock_079.1Beta1-RC3\library\cart\order.php

Q, Can you check the order.php line 105 - 108

Code: Select all

/* foreach ($product['option'] as $option) {
					$sql = "insert into order_option set order_id = '?', order_product_id = '?', name = '?', `value` = '?', price = '?', prefix = '?'";
					$this->database->query($this->database->parse($sql, $order_id, $order_product_id, $option['name'], $option['value'], $product['price'], $option['prefix']));
				} */
Is that duplicate code? I think it is.
I was getting 2 rows written to the order_option table for each option

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Sat Nov 29, 2008 12:40 am

Looks like it... copy/paste strikes again
actually looks like it's really messed there
Ill fix it in a bit

Thx :)
Last edited by Qphoria on Sat Nov 29, 2008 12:43 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Fri Dec 05, 2008 12:08 am

Currently, in cart.php, if check stock is set to yes and
product stock = 0
option stock = 0
(or less than the qty added to cart)
I get 2 pink out of stock warnings in cart page

How do I make it so that I only get "one" warning cos 2 warnings looks silly

I would like it where it does:
If there is no option stock and
There is no product warning
then show the option warning
Otherwise, show the product warning only

or something to that effect.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Fri Dec 05, 2008 12:16 am

jty wrote: Currently, in cart.php, if check stock is set to yes and
product stock = 0
option stock = 0
(or less than the qty added to cart)
I get 2 pink out of stock warnings in cart page

How do I make it so that I only get "one" warning cos 2 warnings looks silly
LOL! That was a feature! In fact, in v0.8, we are looking to change all error messages to be arrays so that multiple errors could be shown on all pages.

The more features you add, the harder it gets to please everybody  >:(

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Fri Dec 05, 2008 12:44 am

Qphoria wrote: The more features you add, the harder it gets to please everybody  >:(
That's true and the more features, the more complicated and slow the program goes.
OK, I will live with 2 pink warnings
If I can't change the software, I will change my attitude. Easy  :P

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Fri Dec 05, 2008 1:14 am

Well i can tell you how to change it.

in catalog/controller/cart.php

change all instances of:
$error[] to $error

in catalog/template/default/content/cart.tpl
change:

Code: Select all

  <?php foreach ($error as $errmsg) { ?>
  <?php if ($errmsg) { ?>
  <div class="warning"><?php echo $errmsg; ?></div>
  <?php } ?>
  <?php } ?>
TO:

Code: Select all

  <?php if ($error) { ?>
  <div class="warning"><?php echo $error; ?></div>
  <?php } ?>
Tho that will only show you the last found error on the page, not necessarily in the priority you'd like. That is why I originally changed it to show ALL errors, so no matter what the priority, you'd see all that was wrong.
Last edited by Qphoria on Fri Dec 05, 2008 1:15 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Fri Dec 05, 2008 3:32 am

Purrfect. That did the trick.
I'm not using min qty and I have no need for 2 warnings so it's Ok to use just the last warning
Thanks again

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am
Who is online

Users browsing this forum: No registered users and 2 guests