Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Actual Attribute Price V1.0


Guest

Recommended Posts

Hi everyone,

 

I've tried to install the contrib last night. Downloaded several versions and even tried the solution posted here. None of them seemed to work. Either the items subtotal in checkout was set to 0.00, I recieved a mysql error or the attributes did not work at all.

Finally merged 3 versions while trying, added a missing ); on the end of the final price ==>... and got it to work properly except for the customer group discount. It's substracted in the shop, but not in the attributes pull down.

Adding attributed items to the cart results in loss of the discount.

 

I'm sure this might just be a small thing I've overlooked, but well, it was finally 6 A.M. when I had the rest to work. :blink:

 

Anybody have an idea?

 

Here's what I have in the section of my shopping_cart.php

 

          $this->weight += ($qty * $products_weight);

 

        }

 

// phpmom.com advanced attribute price

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '+') {

$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

} elseif ($attribute_price['price_prefix'] == '-') {

$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

}

elseif ($attribute_price['price_prefix'] == '')

{ //comment where you see //'0' if want '0' value

// if ($attribute_price['options_values_price'] == '0') { //'0'

// $this->total += 0; //'0'

// } //'0'

 

// if ($attribute_price['options_values_price'] != '0') { //'0'

$this->total += tep_add_tax($attribute_price['options_values_price'], $products_tax) * $qty - (tep_add_tax($products_price, $products_tax) * $qty);

 

// }//'0'

}else $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

}

}

 

      }

    }

 

//PHPMOM.COM AAP

function attributes_price($products_id) {

$attributes_price = 0;

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

} elseif ($attribute_price['price_prefix'] == '-') {

$attributes_price -= $attribute_price['options_values_price'];

}

else

$attributes_price+= $attribute_price['options_values_price'];

}

}

 

return $attributes_price;

}

 

    function get_products() {

      global $languages_id;

 

      if (!is_array($this->contents)) return false;

 

      $products_array = array();

      reset($this->contents);

      while (list($products_id, ) = each($this->contents)) {

        $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

        if ($products = tep_db_fetch_array($products_query)) {

          $prid = $products['products_id'];

          $products_price = $products['products_price'];

 

          /*$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");

          if (tep_db_num_rows($specials_query)) {

            $specials = tep_db_fetch_array($specials_query);

            $products_price = $specials['specials_new_products_price'];

          }*/

 

    global $customer_id;

    $customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

    $customer_group_id = tep_db_fetch_array($customer_group_id_query);

    $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products['products_id'] . "'");

      if (($orders_customers = tep_db_fetch_array($orders_customers_price)) && ($customer_group_id['customers_group_id'] != 0)) {

      $products_price = $orders_customers['customers_group_price'];

    }

         

    if($abc=tep_get_products_special_price($products_id))

            $products_price=$abc;

$attributes_price = 0;

 

    if (isset($this->contents[$products_id]['attributes'])) {

      reset($this->contents[$products_id]['attributes']);

      while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

        $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

        $attribute_price = tep_db_fetch_array($attribute_price_query);

        if ($attribute_price['price_prefix'] == '') {

          $attributes_price += ($attribute_price['options_values_price']-$products_price);

          }  elseif ($attribute_price['price_prefix'] == '+') {

            $attributes_price += $attribute_price['options_values_price'];

        }

            elseif ($attribute_price['price_prefix'] == '-') {

            $attributes_price -= $attribute_price['options_values_price'];

      }

      }

    }     

          $products_array[] = array('id' => $products_id,

                                    'name' => $products['products_name'],

                                    'model' => $products['products_model'],

                                    'image' => $products['products_image'],

                                    'price' => $products_price,

                                    'quantity' => $this->contents[$products_id]['qty'],

                                    'weight' => $products['products_weight'],

                                    'final_price' => ($products_price + $attributes_price),

                                    'attributes_price' => $attributes_price,

                                    'tax_class_id' => $products['products_tax_class_id'],

                                    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));

        }

      }

 

      return $products_array;

 

and here's the order.php

 

      $index = 0;

      $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

      while ($orders_products = tep_db_fetch_array($orders_products_query)) {

        $this->products[$index] = array('qty' => $orders_products['products_quantity'],

                                'id' => $orders_products['products_id'],

                                        'name' => $orders_products['products_name'],

                                        'model' => $orders_products['products_model'],

                                        'tax' => $orders_products['products_tax'],

                                        'price' => $orders_products['products_price'],

                                        'attributes_price'=>$products[$i]['attributes_price'],

                                        'final_price' => $products[$i]['final_price'],);

                    global $customer_id, $customer_group_id;

                    $customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

                    $customer_group_id = tep_db_fetch_array($customer_group_id_query);

                    if ($customer_group_id['customers_group_id'] != '0'){

                    $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");

                    if ($orders_customers = tep_db_fetch_array($orders_customers_price)){

                      //BOF PHPMOM.COM AAP//hadir

                      $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

 

                                      'final_price' => $products[$i]['final_price']);

                    }                             

                    }

//**************************************FINE MODIFICA B2BSuite                   

 

        $subindex = 0;

        $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");

        if (tep_db_num_rows($attributes_query)) {

          while ($attributes = tep_db_fetch_array($attributes_query)) {

            $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],

                                                                    'value' => $attributes['products_options_values'],

                                                                    'prefix' => $attributes['price_prefix'],

                                                                    'price' => $attributes['options_values_price']);

 

            $subindex++;

          }

        }

 

        $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';

 

        $index++;

      }

    }

 

    function cart() {

      global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment;

 

      $this->content_type = $cart->get_content_type();

 

      $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_group_id, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id");

      $customer_address = tep_db_fetch_array($customer_address_query);

 

      $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");

      $shipping_address = tep_db_fetch_array($shipping_address_query);

     

      $billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "'");

      $billing_address = tep_db_fetch_array($billing_address_query);

 

      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");

      $tax_address = tep_db_fetch_array($tax_address_query);

 

      $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,

                          'currency' => $currency,

                          'currency_value' => $currencies->currencies[$currency]['value'],

                          'payment_method' => $payment,

                          'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),

                          'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),

                          'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),

                          'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),

    // begin cvv contribution

                          'cvvnumber' => (isset($GLOBALS['cvvnumber']) ? $GLOBALS['cvvnumber'] : ''),

    // end cvv contribution

                          'shipping_method' => $shipping['title'],

                          'shipping_cost' => $shipping['cost'],

                          'subtotal' => 0,

                          'tax' => 0,

                          'tax_groups' => array(),

                          'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));

 

      if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {

        $this->info['payment_method'] = $GLOBALS[$payment]->title;

 

        if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) {

          $this->info['order_status'] = $GLOBALS[$payment]->order_status;

        }

      }

 

      $this->customer = array('group_id' => $customer_address['customers_group_id'],

              'firstname' => $customer_address['customers_firstname'],

                              'lastname' => $customer_address['customers_lastname'],

                              'company' => $customer_address['entry_company'],

                              'street_address' => $customer_address['entry_street_address'],

                              'suburb' => $customer_address['entry_suburb'],

                              'city' => $customer_address['entry_city'],

                              'postcode' => $customer_address['entry_postcode'],

                              'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),

                              'zone_id' => $customer_address['entry_zone_id'],

                              'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),

                              'format_id' => $customer_address['address_format_id'],

                              'telephone' => $customer_address['customers_telephone'],

                              'email_address' => $customer_address['customers_email_address']);

 

      $this->delivery = array('firstname' => $shipping_address['entry_firstname'],

                              'lastname' => $shipping_address['entry_lastname'],

                              'company' => $shipping_address['entry_company'],

                              'street_address' => $shipping_address['entry_street_address'],

                              'suburb' => $shipping_address['entry_suburb'],

                              'city' => $shipping_address['entry_city'],

                              'postcode' => $shipping_address['entry_postcode'],

                              'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),

                              'zone_id' => $shipping_address['entry_zone_id'],

                              'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),

                              'country_id' => $shipping_address['entry_country_id'],

                              'format_id' => $shipping_address['address_format_id']);

 

      $this->billing = array('firstname' => $billing_address['entry_firstname'],

                            'lastname' => $billing_address['entry_lastname'],

                            'company' => $billing_address['entry_company'],

                            'street_address' => $billing_address['entry_street_address'],

                            'suburb' => $billing_address['entry_suburb'],

                            'city' => $billing_address['entry_city'],

                            'postcode' => $billing_address['entry_postcode'],

                            'state' => ((tep_not_null($billing_address['entry_state'])) ? $billing_address['entry_state'] : $billing_address['zone_name']),

                            'zone_id' => $billing_address['entry_zone_id'],

                            'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']),

                            'country_id' => $billing_address['entry_country_id'],

                            'format_id' => $billing_address['address_format_id']);

 

      $index = 0;

      $products = $cart->get_products();

      for ($i=0, $n=sizeof($products); $i<$n; $i++) {

        $this->products[$index] = array('qty' => $products[$i]['quantity'],

                                        'name' => $products[$i]['name'],

                                        'model' => $products[$i]['model'],

                                        'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

                                        'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),

                                        'price' => $products[$i]['price'],

                                        'final_price' => $products[$i]['final_price'],

                                        'weight' => $products[$i]['weight'],

                                        'id' => $products[$i]['id']);

                   

//*************************INIZIO MODIFICA B2BSuite 

    global $customer_id;

    $customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

    $customer_group_id = tep_db_fetch_array($customer_group_id_query);

              if ($customer_group_id['customers_group_id'] != '0'){

              $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");

              $orders_customers = tep_db_fetch_array($orders_customers_price);

                          if ($orders_customers = tep_db_fetch_array($orders_customers_price)) {

  //BOF PHPMOM.COM AAP//hadir

if (isset($cart->contents[$products[$i]['id']]['attributes'])) {

if ($cart->attributes_prefix($products[$i]['id']) == ''){

$grp_final_price = $cart->attributes_price($products[$i]['id']);

} else

$grp_final_price = ($orders_customers['customers_group_price'] + $cart->attributes_price($products[$i]['id']));

}else $grp_final_price = ($products[$i]['price']); //eof actual attribute//hadir

//eof

////////////////////////////////////////

                       

                         

                        $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

                                          'final_price' => $grp_final_price); //PHPMOM.COM AAP

                        }

                      }

//*************************FINE MODIFICA B2BSuite                                         

 

        if ($products[$i]['attributes']) {

          $subindex = 0;

          reset($products[$i]['attributes']);

          while (list($option, $value) = each($products[$i]['attributes'])) {

            $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");

            $attributes = tep_db_fetch_array($attributes_query);

 

            $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],

                                                                    'value' => $attributes['products_options_values_name'],

                                                                    'option_id' => $option,

                                                                    'value_id' => $value,

                                                                    'prefix' => $attributes['price_prefix'],

                                                                    'price' => $attributes['options_values_price']);

 

            $subindex++;

          }

        }

 

        $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];

        $this->info['subtotal'] += $shown_price;

 

        $products_tax = $this->products[$index]['tax'];

        $products_tax_description = $this->products[$index]['tax_description'];

        if (DISPLAY_PRICE_WITH_TAX == 'true') {

          $this->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

          if (isset($this->info['tax_groups']["$products_tax_description"])) {

            $this->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

          } else {

            $this->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));

          }

        } else {

          $this->info['tax'] += ($products_tax / 100) * $shown_price;

          if (isset($this->info['tax_groups']["$products_tax_description"])) {

            $this->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;

          } else {

            $this->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;

          }

        }

 

        $index++;

 

 

I'm working with MS2, B2B and several other contribs.

Problem can be seen here in our shop at EstatePipes.de

 

 

Hope anybody can help.

 

BTW: Great contrib. ;-)

And a suggestion: How about an add on for changing the price in the products page in real time when a different attribute is selected to show the updated price and not just in the cart?

 

 

Thanks,

 

Stefan

Link to comment
Share on other sites

TO GET THIS WORKING WITH ATTRIBUTE MANAGER....

 

change the line around line 125 of admin/new_attributes_include.php to look like this...

 

 echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-<option value=\"\">=</SELECT></TD>";

 

works for me...

Link to comment
Share on other sites

TO GET THIS WORKING WITH ATTRIBUTE MANAGER....

 

change the line around line 125 of admin/new_attributes_include.php to look like this...

 

 echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-<option value=\"\">=</SELECT></TD>";

 

works for me...

 

Hi adiwillow,

 

thanks, but where do you have the new_attributes_include.php from? I don't have such file.

What Attribute Manager version do you have?

 

 

Stefan

Link to comment
Share on other sites

Just wondering what the hell i need to download and install to get the attribute to work before I even try installing?? Thanks for any help you can give me in finding what I need to download and change. THANKS!!!!!!

Link to comment
Share on other sites

Can someone help me with what exactly I need to download for this contribution so i can install it. Thanks alot guys

 

Hi tates,

 

try this one http://www.dailywholesale.com/creloaded/Ad...rices_1.41.html

 

should work except my problem posted earlier, which obviously nobody has a solution for? No reply or comment to it since two days. :(

 

 

Stefan

Link to comment
Share on other sites

Am trying to get this mod working on the OSCmax version, any ideas how I might adjust the code so that it works, since there are a few lines in the instructions that cannot be found in my product_info.tpl.php file

 

tia

 

umanu

 

 

also what is the difference between the simple and advanced modules, there are so many on he contrib page I am not sure which one to use.

 

could I send my shopping cart, and product_info pages for anyone to successfully apply this mod??

 

thanks

(again) :blink:

Link to comment
Share on other sites

Ok I got the fix.

first-If you commented the total column uncomment it.

Unfortunately for now ADVANCED method will not work. I migth try and get an advanced fix for this later but now I just do not know how it will work.

http://www.dailywholesale.com/creloaded/Ad...rices_1.41.html

very 10x crashwave you are the best !!!

 

Larry

Link to comment
Share on other sites

Hi .............I really need some help (& just to warn you upfront, I really am a dummy!)

 

I've been loading my catalogue on my website without any major hiccups & came to the conclusion that I needed to add the contrubution: actual attribute price (& here is where the problem starts!!)..... I downloaded the contribution & thought that I had followed the instructions correctly (but obviously not!) as when I then went to my website, the store page (or what ever it's called) is now missing & I just have ****???/// showing. Here's what i'm talking about: http://www.moggied.com/ .......what have I done?...I guess that i've done something really wrong (even though I have no idea) Can anyone help me get original homepage back please as I had made a lot of alterations?

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I have followed crashwaves instructions on his website,and everything works fine until i get to the checkout confirmation page where all the product prices are 0.00?

 

Does this mean I have made a mistake on the order.php page?

 

Thanks

Link to comment
Share on other sites

Hi,

I have followed crashwaves instructions on his website,and everything works fine until i get to the checkout confirmation page where all the product prices are 0.00?

 

Does this mean I have made a mistake on the order.php page?

 

Also do I Use:

http://www.dailywholesale.com/creloaded/Ad...rices_1.41.html

or:

http://www.dailywholesale.com/creloaded/Ad...Prices_1.4.html

 

Thanks

Link to comment
Share on other sites

Hi,

 

I was using Actual Attribute Price V1.0 on my site (oscMax ver 1.5.5,) and it

did well. I have just recently upgraded to Osmax ver 1.7. and I am having

trouble getting Actual Attribute Price 1.41 to work correctly. I have gone over

everything at least three times, making sure everthing was in it's place. I did notice that I was unable to find this line in either file page:

 

If using Advanced method

in catalog/shopping_cart.php (or template/shopping_cart)

change

CODE'text' => $attrib_added

to

CODE'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>'

 

Also, I keep getting this error:

 

Parse error: parse error, unexpected '}', expecting ')' in /home/ewheel/public_html/oscmax2/includes/classes/shopping_cart.php on line 735.

 

 

I know this mod is pretty straight foward to install, but at this point I'm stumped.

Any thoughts or comments will be greatly appreciated.

Link to comment
Share on other sites

email in old instruction is no longer used (much) phpmom gmail account is better. Please try before you email me.

 

http://www.dailywholesale.com/creloaded/Ad...rices_1.41.html

 

I do not know about manager..never tried it. If anyone has gotten it to work with it please post and how

 

Thanks

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

  • 3 weeks later...

Like many others as I understand, I have become hesitant about installing this contribution after reading many unanswered questions in this forum, and trying to figure out where to start in the long list of versions and fixes.

 

Are there anyone that uses this with OSC2.2 and it really works? It should be nice to know.

 

Also, I join "umanu" asking again what "Advanced Mode" and "Simple mode" stands for. I have opened and read some of the zip-files, but they seem to be more about how to install than the feature in itself, so it?s hard to see what I might gain by taking the risk starting to install this.

 

How many files are involved?

Any db changes for the contrib?

Does it work well with other contribs, any examples that works fine?

 

BTW - I am working in the area of usability, and it is strange to demand from a customer to do math to figure out what a product costs - so this attrib should have been a basic demand for not scare customers away from a webshop. I hope that I will solve this, maybe with some help from you out there!

 

THanks in advance!

 

/Inkan in Sweden

Link to comment
Share on other sites

hey everyone,

i installed the Actual attriubes and File Upload .7 and QUantity price breakdown

... everything except the cart is working fine . .. .

the cart wont calculate the price and it is different from the checkout price.

it calculated the price of the attribute and not included the base price*qty in it and then it has not been working since long ...

i have tried alot but all invain, i dont want to start from scratch as i have spent alot of time in this

so heres my shopping_cart.php file

from /catalog/includes/classes/

 <?php
/*
 $Id: shopping_cart.php,v 1.35 2003/06/25 21:14:33 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class shoppingCart {
   var $contents, $total, $weight, $cartID, $content_type;

   function shoppingCart() {
     $this->reset();
   }

   function restore_contents() {
     global $customer_id;

     if (!tep_session_is_registered('customer_id')) return false;

// insert current cart contents in database
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $qty = $this->contents[$products_id]['qty'];
         $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
         if (!tep_db_num_rows($product_query)) {
           tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
           if (isset($this->contents[$products_id]['attributes'])) {
             reset($this->contents[$products_id]['attributes']);
             while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
               //clr 031714 udate query to include attribute value. This is needed for text attributes.
               $attr_value = $this->contents[$products_id]['attributes_values'][$option];
               tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
             }
           }
         } else {
           tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
         }
       }
     }

// reset per-session cart contents, but not the database contents
     $this->reset(false);

     $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
     while ($products = tep_db_fetch_array($products_query)) {
       $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
// attributes
       //CLR 020606 update query to pull attribute value_text. This is needed for text attributes.
       $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
       while ($attributes = tep_db_fetch_array($attributes_query)) {
         $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
         //CLR 020606 if text attribute, then set additional information
         if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
           $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text'];
         }
       }
     }

     $this->cleanup();
   }

   function reset($reset_database = false) {
     global $customer_id;

     $this->contents = array();
     $this->total = 0;
     $this->weight = 0;
     $this->content_type = false;

     if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
     }

     unset($this->cartID);
     if (tep_session_is_registered('cartID')) tep_session_unregister('cartID');
   }

   function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
     global $new_products_id_in_cart, $customer_id;

     $products_id = tep_get_uprid($products_id, $attributes);
     if ($notify == true) {
       $new_products_id_in_cart = $products_id;
       tep_session_register('new_products_id_in_cart');
     }

     if ($this->in_cart($products_id)) {
       $this->update_quantity($products_id, $qty, $attributes);
     } else {
       $this->contents[] = array($products_id);
       $this->contents[$products_id] = array('qty' => $qty);
// insert into database
       if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");

       if (is_array($attributes)) {
         reset($attributes);
         while (list($option, $value) = each($attributes)) {
           //CLR 020606 check if input was from text box.  If so, store additional attribute information
           //CLR 020708 check if text input is blank, if so do not add to attribute lists
           //CLR 030228 add htmlspecialchars processing.  This handles quotes and other special chars in the user input.
           $attr_value = NULL;
           $blank_value = FALSE;
           if (strstr($option, TEXT_PREFIX)) {
             if (trim($value) == NULL)
             {
               $blank_value = TRUE;
             } else {
               $option = substr($option, strlen(TEXT_PREFIX));
               $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
               $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
               $this->contents[$products_id]['attributes_values'][$option] = $attr_value;
             }
           }

           if (!$blank_value)
           {
             $this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
           //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
           //CLR 030228 add tep_db_input() processing
             if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
           }
         }
       }
     }
     $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
     $this->cartID = $this->generate_cart_id();
   }

   function update_quantity($products_id, $quantity = '', $attributes = '') {
     global $customer_id;

     if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..

     $this->contents[$products_id] = array('qty' => $quantity);
// update database
     if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");

     if (is_array($attributes)) {
       reset($attributes);
       while (list($option, $value) = each($attributes)) {
         //CLR 020606 check if input was from text box.  If so, store additional attribute information
         //CLR 030108 check if text input is blank, if so do not update attribute lists
         //CLR 030228 add htmlspecialchars processing.  This handles quotes and other special chars in the user input.
         $attr_value = NULL;
         $blank_value = FALSE;
         if (strstr($option, TEXT_PREFIX)) {
           if (trim($value) == NULL)
           {
             $blank_value = TRUE;
           } else {
             $option = substr($option, strlen(TEXT_PREFIX));
             $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
             $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
             $this->contents[$products_id]['attributes_values'][$option] = $attr_value;
           }
         }

         if (!$blank_value)
         {
           $this->contents[$products_id]['attributes'][$option] = $value;
// update database
           //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
           //CLR 030228 add tep_db_input() processing
           if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
         }
       }
     }
   }

   function cleanup() {
     global $customer_id;

     reset($this->contents);
     while (list($key,) = each($this->contents)) {
       if ($this->contents[$key]['qty'] < 1) {
         unset($this->contents[$key]);
// remove from database
         if (tep_session_is_registered('customer_id')) {
           tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
           tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
         }
       }
     }
   }

   function count_contents() {  // get total number of items in cart
     $total_items = 0;
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $total_items += $this->get_quantity($products_id);
       }
     }

     return $total_items;
   }

   function get_quantity($products_id) {
     if (isset($this->contents[$products_id])) {
       return $this->contents[$products_id]['qty'];
     } else {
       return 0;
     }
   }

   function in_cart($products_id) {
     if (isset($this->contents[$products_id])) {
       return true;
     } else {
       return false;
     }
   }

   function remove($products_id) {
     global $customer_id;

     //CLR 030228 add call tep_get_uprid to correctly format product ids containing quotes
     $products_id = tep_get_uprid($products_id, $attributes);

     unset($this->contents[$products_id]);
// remove from database
     if (tep_session_is_registered('customer_id')) {
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
       tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
     }

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
     $this->cartID = $this->generate_cart_id();
   }

   function remove_all() {
     $this->reset();
   }

   function get_product_id_list() {
     $product_id_list = '';
     if (is_array($this->contents)) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         $product_id_list .= ', ' . $products_id;
       }
     }

     return substr($product_id_list, 2);
   }

   function calculate() {
     $this->total = 0;
     $this->weight = 0;
     if (!is_array($this->contents)) return 0;

     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
       $qty = $this->contents[$products_id]['qty'];

// products price
       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       if ($product = tep_db_fetch_array($product_query)) {
         $prid = $product['products_id'];
         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
         $products_price = $product['products_price'];
         $products_weight = $product['products_weight'];

         $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
         if (tep_db_num_rows ($specials_query)) {
           $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_new_products_price'];
         }

/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
// BOF - AAP V1.2.1 - updated to account for no price prefix to equal actual price
// attributes price

       if (!isset($this->contents[$products_id]['attributes']))
 {
         $this->total += tep_add_tax($products_price, $products_tax) * $qty;
 }
         $this->weight += ($qty * $products_weight);
       }


       if (isset($this->contents[$products_id]['attributes'])) {
         reset($this->contents[$products_id]['attributes']);
         while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
           $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
           $attribute_price = tep_db_fetch_array($attribute_price_query);
           $price_prefix = $attribute_price['price_prefix'];
           $option_price = $attribute_price['options_values_price'];
             $products_query = tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
             $products_stuff = tep_db_fetch_array($products_query);
             $products_price = $products_stuff['products_price'];
           if ($price_prefix == '+') {
             $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
           }
             if ($price_prefix == '-') {
             $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
           }


           if ($price_prefix == '')
           {  
             if ($attribute_price['options_values_price'] == '0')
               $this->total += tep_add_tax($products_price, $products_tax) * $qty;
           }

           if ($attribute_price['options_values_price'] > '0') {
             if ($price_prefix == '') {
        	 if (ceil($option_price) != ceil($products_price))
          {
           $this->total += tep_add_tax($attribute_price['options_values_price'], $products_tax) * $qty;
          }
          else
          {
             $this->total += tep_add_tax($products_price, $products_tax) * $qty;
           $this->total += tep_add_tax(tep_adjust_price($option_price, $products_price), $product_tax) * $qty;
        	 }

             }
           }
         }
       }
     }
   }

// subtotal function for attributes price
   function attributes_price($products_id) {
     $attributes_price = 0;

     if (isset($this->contents[$products_id]['attributes'])) {
       reset($this->contents[$products_id]['attributes']);
       while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
         $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
         $attribute_price = tep_db_fetch_array($attribute_price_query);
         $price_prefix = $attribute_price['price_prefix'];
         $option_price = $attribute_price['options_values_price'];
         $products_query = tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
         $products_stuff = tep_db_fetch_array($products_query);
         $products_price = $products_stuff['products_price'];
         //Check for special price
         $products_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$products_id . "'");
         $products_stuff = tep_db_fetch_array($products_query);
         if($products_stuff['specials_new_products_price'] != ''){
           $products_price = $products_stuff['specials_new_products_price'];
         }
         if ($price_prefix == '+') {
           $attributes_price += $option_price;
         }
         if ($price_prefix == '-') {
           $attributes_price -= $option_price;
         }
         if (($price_prefix == '') and  ($option_price > 0))
           $attributes_price += tep_adjust_price($option_price,$products_price);
         else
           $attributes_price+= $option_price;
       }
     }
     return $attributes_price;
   }
// EOF - AAP V1.2.1
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////

   function get_products() {
     global $languages_id;

     if (!is_array($this->contents)) return false;

     $products_array = array();
     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
       if ($products = tep_db_fetch_array($products_query)) {
         $prid = $products['products_id'];
         $products_price = $products['products_price'];

         $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
         if (tep_db_num_rows($specials_query)) {
           $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_new_products_price'];
         }

         //clr 030714 update $products_array to include attribute value_text. This is needed for text attributes.
         $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
                                   'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : ''));

       }
     }

     return $products_array;
   }

   function show_total() {
     $this->calculate();

     return $this->total;
   }

   function show_weight() {
     $this->calculate();

     return $this->weight;
   }

   function generate_cart_id($length = 5) {
     return tep_create_random_value($length, 'digits');
   }

   function get_content_type() {
     $this->content_type = false;

     if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
       reset($this->contents);
       while (list($products_id, ) = each($this->contents)) {
         if (isset($this->contents[$products_id]['attributes'])) {
           reset($this->contents[$products_id]['attributes']);
           while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
             $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
             $virtual_check = tep_db_fetch_array($virtual_check_query);

             if ($virtual_check['total'] > 0) {
               switch ($this->content_type) {
                 case 'physical':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'virtual';
                   break;
               }
             } else {
               switch ($this->content_type) {
                 case 'virtual':
                   $this->content_type = 'mixed';

                   return $this->content_type;
                   break;
                 default:
                   $this->content_type = 'physical';
                   break;
               }
             }
           }
         } else {
           switch ($this->content_type) {
             case 'virtual':
               $this->content_type = 'mixed';

               return $this->content_type;
               break;
             default:
               $this->content_type = 'physical';
               break;
           }
         }
       }
     } else {
       $this->content_type = 'physical';
     }

     return $this->content_type;
   }

   function unserialize($broken) {
     for(reset($broken);$kv=each($broken);) {
       $key=$kv['key'];
       if (gettype($this->$key)!="user function")
       $this->$key=$kv['value'];
     }
   }

 }
?>

 

i have tried alot , but icant figure out how to fix it

if you would try it out urself : the website is

http://www.landcareprojects.com/catalog

and my old working website is : www.bargaintees.com

Thanks for your time, i appreciate it

and please do reply if you think somthing can help me

thanks ,

mark

Edited by gingermark
Link to comment
Share on other sites

Mark,

I hope you solve it somehow, but I think that the Actual Attribute Price thinking might be the wrong angle to some shops. For me, I started to think of it as different products that needed to be grouped as one - instead of one product in different versions. I gave up on the Actual Attribute Price contrib after three days (and nights) of trying to get it to work (for my needs), and are now installing the "Master Products" attribute - where you can create a "Master" product and add "slave" products beneath it. I am not sure that it works for me either/yet, but both the threads about it and the description and coding itself seems much more comforting than the "AAP" contib. That contrib is actually at least two different contribs that are not advanced in function, some versions is actually a step backwards - and lost of "sorry I forgot.." and "I forgot another thing.." updates.

 

I am not saying that it?s not the right thing for you, but think twice - maybe the stock problem is one sign that you should think of it as different products - grouped together as one.

 

Sorry that I could?t help !

 

/Inkan

Link to comment
Share on other sites

thanks for replying inkan

i am checking out the master attribute

will it let me have pricing different according to the quantity ordered though?

 

I am not sure of that, maybe someone can reply to you in the official thread for that contrib: http://www.oscommerce.com/forums/index.php?sho...c=67284&st=1240

 

I have the need for selling a product that comes in bottles and cans of different sizes. If that is what you mean by "quantity" I think that it works, but you will have to add each different quantity as a slave product. That is - if I understood the functions of the contrib right.

 

I have started to install it, but it?s a lot of changes and I haven?t got them all working yet (I get some blank pages, have to look for the errors). Look into what it does and don?t before you add the "Master Products" contrib, because it is a lot of changes to do - and uninstalling it will be a lot of work if you change your mind.

I will post again when I have more to say about it, it has been too much other activities around here in the last couple of days, haven?t got the time for computers.

 

/Inkan :'(

Link to comment
Share on other sites

  • 4 weeks later...

I tried this contribution for a hour or so and no joy.

 

The instructions are BAD ! what files am i supposed to alter and what am i supposed to delete?

 

People here talkin about the orders.php but i never saw an instruction to alter that!

 

After a lot of messin around i found this one:

 

http://www.oscommerce.com/community/contributions,2487

 

Way way way simpler, one mod in one file (it tells you the name of the file to change on the contrib page) and it seems to be working.

 

Anyone have clearer instuctions on this one? and will it actually do anything better/different?

 

 

Ian

Link to comment
Share on other sites

  • 3 weeks later...
I tried this contribution for a hour or so and no joy.

 

The instructions are BAD ! what files am i supposed to alter and what am i supposed to delete?

 

People here talkin about the orders.php but i never saw an instruction to alter that!

 

After a lot of messin around i found this one:

 

http://www.oscommerce.com/community/contributions,2487

 

Way way way simpler, one mod in one file (it tells you the name of the file to change on the contrib page) and it seems to be working.

 

Anyone have clearer instuctions on this one? and will it actually do anything better/different?

Ian

 

I'm inclined to agree. The instructions ARE terrible. Mine, which is integrated into a CRE-Loaded OSC works in the cart, but not on the products_info page. I can't even find where anything like this is addressed in the instructions or in this string. This would be a good contrib, since it adds the price to the overall price in the shopping cart and carries it through to the checkout, but falls flat because of the lack of good instructions.

Link to comment
Share on other sites

Can any 1 help me on this ....followed instrustions i downloaded from here ...... http://www.dailywholesale.com/creloaded/Ad...rices_1.41.html.

 

 

i get this ...... Parse error: parse error, unexpected ';', expecting ')' in /home/*******/public_html/catalog/includes/classes/shopping_cart.php on line 299

 

 

This is the code i copied of the above file .............

 

 

5-in classes/shopping_cart.php above

 

$products_array[] = array('id' => $products_i

add

//BOF PHPMOM.COM AAP//hadir

$attributes_price = 0;

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '') {

$attributes_price += ($attribute_price['options_values_price']-$products_price);

} elseif ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

}

elseif ($attribute_price['price_prefix'] == '-') {

$attributes_price -= $attribute_price['options_values_price'];

}

}

} //eof actual attribute//hadir

 

 

----------------------------------------------------------------------------------------------------

And replaced this in the shopping cart.php ................................

 

$products_array[] = array('id' => $products_id,

 

SHOULD THE CODE GO HERE

 

'name' => $products['products_name'],

'model' => $products['products_model'],

'image' => $products['products_image'],

'price' => $products_price,

'quantity' => $this->contents[$products_id]['qty'],

'weight' => $products['products_weight'],

'final_price' => ($products_price + $this->attributes_price($products_id)),

'tax_class_id' => $products['products_tax_class_id'],

'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));

}

}

................................................................................

.....................................................

LIKE THIS...

 

$products_array[] = array('id' => $products_id,

//BOF PHPMOM.COM AAP//hadir

$attributes_price = 0;

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '') {

$attributes_price += ($attribute_price['options_values_price']-$products_price);

} elseif ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

}

elseif ($attribute_price['price_prefix'] == '-') {

$attributes_price -= $attribute_price['options_values_price'];

}

}

} //eof actual attribute//hadir

 

'name' => $products['products_name'],

'model' => $products['products_model'],

'image' => $products['products_image'],

'price' => $products_price,

'quantity' => $this->contents[$products_id]['qty'],

'weight' => $products['products_weight'],

'final_price' => ($products_price + $this->attributes_price($products_id)),

'tax_class_id' => $products['products_tax_class_id'],

'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));

}

}

................................................................................

............................

OR I GOT IT ALL WRONG PLEASE HELP?! THANKS

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...