anarcho, on 26 August 2011 - 05:01 PM, said:
Hi,
thanks for your great work.
I got this Version: osCommerce Online Merchant v2.3.1 and installed Master Products and Magic Variants for OSCOM V2.3x
Version 2.0.
The problem is, that when I) add the "normal" product attributes ("Send product as a gift" - yes/no as radio buttons), the "buy now" - Button doesnt work anymore,
redirects me to the product instead of to the shopping cart.
This piece of code in application_top does the redirect if there are attributes:
// performed by the 'buy now' button in product listings and review page
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
Why does it redirect if a master has attributes ???
I tried this, but it doesnt add a product, just shows an empty cart:
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
$cart->add_cart($HTTP_GET_VARS['products_id'], 1);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
What code do I have to change to make it work ?
best wishes from Germany
Bernd
Hi
I understand why you are having problems creating new features for a Master item.
A Master Product is a "dummy" product that is used to round up items that could make up a set of items that are many times purchased together even though they could be listed in different categories. To a point, they could be almost considered a "mini" subcategory.
A master product is an enhancement that can either add information to a group of products that you do not want in a separate category, or could be used to create a great sales pitch for a group of products when you do not want to add a contribution that allows category descriptions. (A very useful contribution. If you are not using it, you should check one out.) Making a Master product for sale or giving it attributes is really at cross purposes with the intention of the contribution, regardless of the version of osCommerce you are using. Making the Master items (and some will disagree, I know) for sale is not good practice. If you need to have sales and attributes for Master items, you probably need to consider another contribution.
Please carefully consider what it is you are trying to accomplish here. If you need to sell a set, set up a product code offering the set as a whole purchase, maybe with a small discount compared to buying each item. You can set it as a slave to show under your master listing. That might be less confusing to your customers than trying to buy an item, a master set, and so on.
By the way, the original author is long gone, and it appears that those who have so graciously added updated versions have left also, leaving this as a totally user supported contribution. I can attempt to help, but have so many contributions, changes and updates added to my code that my help will necessarily be somewhat general. Also, I use a heavily modified osCommerce roughly equivilant to RC2a, and have zero familiarity with the update for osCommerce 2.3.x versions as I do not wish to totally obscure the code with java scripts. So I will probably not be able to offer any intelligent comments on that version.
HTH
George