maz
Archived-
Posts
160 -
Joined
-
Last visited
Profile Information
-
Real Name
mazhar
maz's Achievements
-
### POINTS AND REWARDS MODULE V1.00 ###
maz replied to deep-silver's topic in General Add-Ons Support
In redemptions.php the $points_toadd are calculated on the total order amount . Does any body know if the 'totals' in the function below are taken from orders.php file in classes folder ? else $points_toadd = $order->info['total']; -
### POINTS AND REWARDS MODULE V1.00 ###
maz replied to deep-silver's topic in General Add-Ons Support
I need some help please. -
### POINTS AND REWARDS MODULE V1.00 ###
maz replied to deep-silver's topic in General Add-Ons Support
URGENTLY NEED HELP to get my modification of this module working... I need to give some selected products unique points values. So product A has 2points, product B has 3 points, etc. These points are SET BY ME in admin for these 'selected' products. ALL OTHER PRODUCTS WILL CONTINUE TO GET AUTO CALCULATED POINT VALUES calculated by the standard product price x POINTS_PER_AMOUNT_PURCHASE which already exists within the points rewards contribution. Method I am using: I created a new cloumn in the products table called 'products_setpoints' . I added a new entry box on the product description page in admin, so that for each new product I can give a SET POINTS VALUE. Now every product can have whatever points value i want. The DEFAULT value for the 'products_setpoints' is 0 in the database. I think that the points values are calculated in the catalog/includes/functions/redemptions.php file. The 2 functions I am looking at are // calculate the shopping points value for the customer function tep_calc_shopping_pvalue($points) { return((float)$points * (float)REDEEM_POINT_VALUE); } function tep_display_points($products_price, $products_tax, $quantity = 1) { if ((DISPLAY_PRICE_WITH_TAX == 'true') && (USE_POINTS_FOR_TAX == 'true')) { $products_price_points_query = tep_add_tax($products_price, $products_tax) * $quantity; } else { $products_price_points_query = $products_price * $quantity; } return $products_price_points_query; } // calculate the shopping points for any products price function tep_calc_products_price_points($products_price_points_query) { $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; return $products_points_total; } What i need to do is change these functions so that IF i have added a 'products_setpoints' value for a product then this value should be used in the first instance, and if the value is 0 then the normal points calcualtions are applied. I just need to change the function to say: Do an additional query to find values in 'products_setpoints' field of the products table and IF $products_setpoints > 0 (i.e. products have a set points value) THEN DO this $products_points_total = $products_price_points_query * $products_setpoints ; ELSE DO this $products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE; THEN obviously return the value return($products_points_value); But I am not sure how to write this query. PLEASE CAN ANYONE HELP. I am sure this mod would help everyone. It gives the best of both worlds. Automatically calculated points AND individually set points. If I can get it working I will post the complete files for everyone else. -
Excellent. Also, I know the coupons do a % discount. Can I also create coupons with specific values. For example coupon value ?1, coupon value ?5 , etc.
-
I am a bit confused. Someone on the forum suggested that I need to install the Credit Class & Gift Voucher contribution first. Is that correct? Ireally dont need that one.. I only need coupons and this 'Discount Coupon Codes' would be great if it works on its own. Please advise.. Thanks
-
### POINTS AND REWARDS MODULE V1.00 ###
maz replied to deep-silver's topic in General Add-Ons Support
Overriding the points value for SELECTED products I want to over ride the points value for SOME SELECTED PRODUCTS. For the rest of the products I already have the points system working perfectly. For example when adding/editing a new product in ADMIN, I need a box under the price box which says POINTS VALUE (for this product). If left empty, then the products point value is linked to its price. BUT if I give the product a points value of say 5points, it will always have 5 points no matter what its price. WHY? I have some products costing say $5 $10 $15 etc. Each yeilding 5,10 and 15 points respectively. That's fine. BUT I also have free products - AND I WANT TO GIVE POINTS WITH THEM TOO. With FreeProduct-A I want to give 6points, with FreeProduct-B 9points, and so on. These points are ARBITRARY AND HAVE NO RELATION TO THE COST OF THE FREEPRODUCT. So I can give any SELECTED product any points i want, whilst at the same time allowing all other products to have points linked to their price. the admin part seems straight forward: 1. I can Add an extra text entry box in the add/edit new product page in admin for PRODUCT_POINTS. 2. I can make this work so it records the entered points into the database. I can create a 'product_points' column in the 'products' table, so that each product has a points value. PRODUCT INFO: I can also add the call to the database to get the product _point value for each product (if it exists). WHAT I NEED IS SOME GUIDANCE ON HOW TO: 1. For every selected FREE product, display the product_point on each product_info page. 2. Code the following during the checkout process: IF the product has a value for product_point greater than 0, THEN use THIS VALUE in the points calculation, otherwise if the product has a value of 0 product_points, then use the normal 'price-linked' points value during the checkout process, AND OBVIOUSLY, TO UPDATE THE USERS POINTS ACCOUNT SYSTEM ACCORDINGLY ANY help on this would be greatly appreciated. Many thanks -
sorry. crossposted. Removed and reposted in POINTS REWARDS section
-
Hi I am trying to add the contribution ALLPRODUCTS with multi-stores. I only need a copy of allprods.php on the one main site. It works, BUT it lists ALL the products - even the ones from the second multi-stores site. I want it to show products from ONLY the main store. So I tried adjusting the sql calls and have got it 'half working'. I dont understand the 'join' bits too well so I am not sure if i am adding the multi-sites bit properly. Original allprod.php page is listed below. I have marked the chages I made for multistores. Would appreciate an expert opinion to correct any mistakes. <?php require('includes/application_top.php'); include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS); $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL')); $firstletter=$HTTP_GET_VARS['fl']; if (!$HTTP_GET_VARS['page']){ $where="where pd.products_name like '$firstletter%'"; }else { $where="where pd.products_name like '$firstletter%'"; } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: WebMakers.com Changed: Header Tag Controller v2.55 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v1.0 ?> <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {?> <td><h1><?php echo HEADING_TITLE; ?></h1></td> <?php } else { ?> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <?php } ?> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> <tr> <td class="main"><?php echo HEADING_SUB_TEXT; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table></td> </tr> <tr> <td align="center" class="smallText"><?php $firstletter_nav= '<a href="' . tep_href_link("allprods.php", 'fl=A', 'NONSSL') . '"> A |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=B', 'NONSSL') . '"> B |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=C', 'NONSSL') . '"> C |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=D', 'NONSSL') . '"> D |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=E', 'NONSSL') . '"> E |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=F', 'NONSSL') . '"> F |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=G', 'NONSSL') . '"> G |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=H', 'NONSSL') . '"> H |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=I', 'NONSSL') . '"> I |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=J', 'NONSSL') . '"> J |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=K', 'NONSSL') . '"> K |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=L', 'NONSSL') . '"> L |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=M', 'NONSSL') . '"> M |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=N', 'NONSSL') . '"> N |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=O', 'NONSSL') . '"> O |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=P', 'NONSSL') . '"> P |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=Q', 'NONSSL') . '"> Q |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=R', 'NONSSL') . '"> R |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=S', 'NONSSL') . '"> S |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=T', 'NONSSL') . '"> T |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=U', 'NONSSL') . '"> U |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=V', 'NONSSL') . '"> V |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=W', 'NONSSL') . '"> W |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=X', 'NONSSL') . '"> X |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=Y', 'NONSSL') . '"> Y |</A>' . '<a href="' . tep_href_link("allprods.php", 'fl=Z', 'NONSSL') . '"> Z</A>??' . '<a href="' . tep_href_link("allprods.php", '', 'NONSSL') . '"> FULL</A>'; echo $firstletter_nav; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php // create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($column, $value) = each($define_list)) { if ($value) $column_list[] = $column; } $select_column_list = ''; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_NAME') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) { continue; } } // CHANGED THIS PART FOR MULTISTORES /* THIS WAS THE ORIGINAL $listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id $where order by pd.products_name"; */ // BOF MULTIISTORES CHANGE $listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id and s.stores_id = '" . STORES_ID . "', " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c INNER JOIN " . TABLE_PRODUCTS_TO_STORES . " p2s ON p.products_id = p2s.products_id where p2s.stores_id = '" . STORES_ID . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id order by pd.products_name"; // EOF MULTISTORES CHANGE if (ALL_PRODUCTS_DISPLAY_MODE == 'true') include(DIR_WS_MODULES . 'product_listing.php'); //display in standard format else include(DIR_WS_MODULES . 'allprods.php'); ?> </td> </tr> </table></td> <!-- body_text_eof //--> <td width="<?php //echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php //echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php //require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> The ALLPRODUCTS page seems to work. BUT i am sure there are errors somewhere. It does call products from main site . BUT the A-Z links are not working. I'm sure its just the database call which is the problem. Any help on this would be appreciated. Many thanks
-
[Contribution] All Products v3.0 MS 2.2 with Images
maz replied to Farrukh's topic in General Add-Ons Support
All products and Multi-stores. I have nearly got it to work. I can get All products to list from the 'enabled' products or categories in main (current) store and not from other store. HOWEVER, the problem is that the A-Z is not working. This is the original sql in all_prods.php $listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id $where order by pd.products_name"; I changed it to this for multi-stores: $listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id and s.stores_id = '" . STORES_ID . "', " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c INNER JOIN " . TABLE_PRODUCTS_TO_STORES . " p2s ON p.products_id = p2s.products_id where p2s.stores_id = '" . STORES_ID . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id order by pd.products_name"; Thats all i changed. Now when i call the all_prod.php page, it lists ONLY the products on the store I am on. BUT the A-Z does not work. ANy help would be appreciated. Many thanks. -
### POINTS AND REWARDS MODULE V1.00 ###
maz replied to deep-silver's topic in General Add-Ons Support
Hi I have created a gift category where customers can exchange points for gifts. Just need to put some statements up showing the points values. 1. How can I show the points value of a product if someone wants to redeem all their products against it. i.e. On the product info page I want to say Product equivalent price ?12 Or get it for 1200 points (assuming 1 point is ?0.01).(at the moment i can only get it to show 12points) 2. How can I show the '1200' points value in the product_listing.php page Any help would be appreciated. Many thanks -
Sorry this was in the wrong forum. should have been in points rewards
-
Hi How can I show the number of points in the product_listing.php page Many thanks
-
Hi Where it shows price schedules in the boxes on the Product info page, i just need to add some text. At the moment it shows 1+ ?30 2+ ?15 etc. I want to add the word 'Buy' so it reads: Buy 1 ?30 Buy 2 ?15 Thanks.
-
My category layout is this: Top level: Laser Toners Subcategories: Cannon, Epson, HP, Apple Cannon, Epson, HP, Apple all have further multiple sub-sublevels. Is it possible for the menu to show JUST the subcategories Cannon, Epson, HP, Apple How can I do this Many thanks.
-
My category layout is this: Top level: Laser Toners Subcategories: Cannon, Epson, HP, Apple Cannon, Epson, HP, Apple all have further multiple sub-sublevels. At the moment clicking Laser toners brings up a page which shows all categories, subcategories and all further sub-subcategories all listed on one extensive page. Its too long and needs to be broken up. What I need is this, Clicking Laser toners brings up a page which lists ONLY the first level sub categories: Cannon, Epson, HP, Apple (NOT THEIR SUB-LEVELS). In rows with blue back ground (like now, bute without showing subcats) Then clicking Cannon goes to the category Cannon with a list of all its multilevel sub-categories. How can I do this Many thanks.