In Progress

Product Price Change per Attribute Choices

Implement the attached file using this function...

function getPrice(price,product_id,attr_arr)

{

opt_id = [url removed, login to view]("optionsid").value;

xmlHttpObj = getxmlHttpObj();

xmlHttpObj.onreadystatechange=function()

{

if(xmlHttpObj.readyState==4)

{

[url removed, login to view]("display_price").innerHTML = [url removed, login to view];

}

}

[url removed, login to view]("GET","[url removed, login to view]"+price+"&option_id="+opt_id+"&product_id="+product_id+"&product_opt="+attr_arr,true);

[url removed, login to view]();

}

and follow this code as a guide to make the dropdowns in the attached [url removed, login to view] work this way.

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

?>

<p>

<?php

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

$numberofopt = tep_db_num_rows($products_options_name_query);

$opt_count = 0;

$products_attributes = array();

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

array_push($products_attributes,$products_options_name['products_options_id']);

$opt_count++;

$products_options_array = array();

//<!-- AJAX Attribute Manager -->

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.products_options_sort_order");

//<!-- AJAX Attribute Manager end -->

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

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

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<b><?php echo $products_options_name['products_options_name'] . ':'; ?></b> <?php

$comma = "";

$all_option_js = "[";

for($t = 1;$t<=$numberofopt; $t++)

Skills: AJAX, eCommerce, Shopping Carts

See more: ajax attribute price change, change price ajax, price file, pa id, attribute, open cart total, total product price, change text file, product price, implement ajax cart, product text, ajax attribute manager, price per, ajax price change, per order, cart change, echo file php, php echo file, text change, attribute code change, open cart using, product order, per file attached, attribute manager, ajax file manager php

About the Employer:
( 89 reviews ) Dubai, United Arab Emirates

Project ID: #1270466

Awarded to:

ExcellenceonPHP

as discussed.

$40 USD in 1 day
(18 Reviews)
4.8