Zen Cart Logo
Forums / All Other Contributions/Addons / Reward Points Module for ZC v13x

Reward Points Module for ZC v13x

Locked

Views: 470,639

Results 581 to 600 of 2,476
This thread is locked. New replies are disabled.
14 Nov 2008, 9:54 AM
#581
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Reward Points Module for ZC v13x

christon26:

Hi Andrew, I do have the code in there, it just won't call the display, and I have no idea why LOL

This is the code for my product info page:

<?php /** * Page Template * * Loaded automatically by index.php?main_page=product_info.<br /> * Displays details of a typical product * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_product_info_display.php 5369 2006-12-23 10:55:52Z drbyte $ */ //require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php'); ?> <div class="centerColumn" id="productGeneral"> <!--bof Form start--> <?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data"') . "\n"; ?> <!--eof Form start--> <?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?> <!--bof Category Icon --> <?php if ($module_show_categories != 0) {?> <?php /** * display the category icons */ require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?> <?php } ?> <!--eof Category Icon --> <!--bof Prev/Next top position --> <?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?> <?php /** * display the product previous/next helper */ require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?> <?php } ?> <!--eof Prev/Next top position--> <br class="clearBoth" /> <!--bof Product Name--> <div class="ProductDescriptionHeading"> <h2 class="centerBoxHeading"><?php echo $products_name; ?></h2> </div> <!--eof Product Name--> <br class="clearBoth" /> <!--bof Main Product Image --> <?php if (zen_not_null($products_image)) { ?> <?php /** * display the main product image */ require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?> <?php } ?> <!--eof Main Product Image--> <br class="clearBoth" /> <div style="text-align:center;"> <!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <?php // base price if ($show_onetime_charges_description == 'true') { $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />'; } else { $one_time = ''; } echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); ?></h2> <!--eof Product Price block --> <!--bof Product Reward Points block --> <h2 id="productRewardPoints" class="productRewardPoints"> <?php /** * display the product reward points */ include($template->get_template_dir('/tpl_product_reward_points.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_product_reward_points.php'); ?> </h2> <!--eof Product Reward Points block --> <!--bof Product details list --> <p><?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?> <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '' : '') . "\n"; ?> <?php } ?><br /><br /> <!--eof Product details list --> <!--bof Product date added/available--> <?php if ($products_date_available > date('Y-m-d H:i:s')) { if ($flag_show_product_info_date_available == 1) { ?> <?php echo sprintf(TEXT_DATE_AVAILABLE, zen_date_long($products_date_available)); ?><br /><br /> <?php } } else { if ($flag_show_product_info_date_added == 1) { ?> <?php echo sprintf(TEXT_DATE_ADDED, zen_date_long($products_date_added)); ?><br /><br /> <?php } // $flag_show_product_info_date_added } ?> <?php echo ($flag_show_product_info_reviews_count == 1 ? TEXT_CURRENT_REVIEWS . ' ' . $reviews->fields['count'] : ''); ?></p> <!--eof Product date added/available --> </div> <!--bof Product description --> <div class="ProductDescriptionHeading"> <h2 class="centerBoxHeading">Product Description</h2> </div> <div style="text-align:center;"> <?php if ($products_description != '') { ?> <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div> <?php } ?> </div> <!--eof Product description --> <br class="clearBoth" /> <!--bof Attributes Module --> <?php if ($pr_attr->fields['total'] > 0) { ?> <?php /** * display the product atributes */ require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?> <?php } ?> <!--eof Attributes Module --> <!--bof Add to Cart Box --> <?php if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') { // do nothing } else { ?>
        <?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
        if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
          // hide the quantity box and default to 1
          $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
          // show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);

?>

<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
  echo $display_qty;
  echo $display_button;
        ?>
      </div>
<?php } // display qty and button ?> <?php } // CUSTOMERS_APPROVAL == 3 ?> <!--eof Add to Cart Box--> <br class="clearBoth" /> <!--bof Additional Product Images --> <?php /** * display the products additional images */ require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?> <!--eof Additional Product Images --> <!--Webmaster Edit Section Removal --> <!--bof Prev/Next bottom position --> <?php if (PRODUCT_INFO_PREVIOUS_NEXT == 2 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?> <?php /** * display the product previous/next helper */ require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?> <?php } ?> <!--eof Prev/Next bottom position --> <br class="clearBoth" /> <!--bof Ask a Question button --> <div id="productAskQuestionLink" class="buttonRow forward"> <?php echo '<a href="' . zen_href_link(FILENAME_ASK_A_QUESTION, 'products_id=' . $_GET['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_ASK_A_QUESTION, BUTTON_ASK_A_QUESTION_ALT) . '</a>'; ?> </div> <!--eof Ask a Question button --> <!--bof Tell a Friend button --> <?php if ($flag_show_product_info_tell_a_friend == 1) { ?> <div id="productTellFriendLink" class="buttonRow forward"><?php echo ($flag_show_product_info_tell_a_friend == 1 ? '<a href="' . zen_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $_GET['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_TELLAFRIEND, BUTTON_TELLAFRIEND_ALT) . '</a>' : ''); ?> </div> <?php } ?> <!--eof Tell a Friend button --> <!--bof Reviews button and count--> <?php if ($flag_show_product_info_reviews == 1) { // if more than 0 reviews, then show reviews button; otherwise, show the "write review" button if ($reviews->fields['count'] > 0 ) { ?> <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) . '</a>'; ?></div> <br class="clearBoth" /> <?php } else { ?> <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div> <br class="clearBoth" /> <?php } } ?> <!--eof Reviews button and count --> <!--bof free ship icon --> <?php if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?> <div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div> <?php } ?> <!--eof free ship icon --> <!--bof Product URL --> <?php if (zen_not_null($products_url)) { if ($flag_show_product_info_url == 1) { ?>
<p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php } // $flag_show_product_info_url } ?> <!--eof Product URL --> <!--bof also purchased products module--> <?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?> <!--eof also purchased products module--> <!--bof Form close--> </form> <!--bof Form close--> </div> ```And this is the code for the tpl_product_reward_points.php that was included in the download: > > ```php <?php /** * Module Template * * @package templateSystem * @copyright Copyright 2008 Andrew Moore * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 */ if(isset($_REQUEST['products_id'])) { $products_id=$_REQUEST['products_id']; //if(REWARD_POINTS_SPECIAL_ADJUST=='0') //echo (int)((zen_get_products_base_price($products_id)*GetRewardPointRatio($products_id))+REWARD_POINTS_ROUNDING); //else echo (int)GetProductRewardPoints($products_id);
    echo ' '.PRODUCT_REWARD_POINT_TAG;
}

?>


Make sure that tpl_product_reward_points.php is in your custom template directory in the 'templates' folder.
14 Nov 2008, 9:58 AM
#582
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Yep, it's in there LOL this seems to be a mystery :blush:

14 Nov 2008, 1:03 PM
#583
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

christon26:

Yep, it's in there LOL this seems to be a mystery :blush:

Okay- got it sorted.

14 Nov 2008, 6:11 PM
#584
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Yay I can see it there now LOL thank you!

How come it wasn't showing before.....was it user error? lol :P

14 Nov 2008, 7:07 PM
#585
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

christon26:

Yay I can see it there now LOL thank you!

How come it wasn't showing before.....was it user error? lol :P

Your server wasn't handling $_REQUESTs so I added $_GET to the mix.

14 Nov 2008, 7:10 PM
#586
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Ahh ok, thanx!

lol I just moved servers a couple of days ago to get them to upgrade the MySQL so I could use this mod LOL

16 Nov 2008, 9:01 PM
#587
starbuck avatar

starbuck

New Zenner

Join Date:
Jun 2008
Posts:
47
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Boogy:

Thanks for this, everything is working great accept for 1 thing. I have "Adjust Reward Points for Sales/Specials" set up so that you will earn points based on whatever the sale price is, not the regular price. This is confirmed when you click on an item. For example, if a product is on sale for $17.00, marked down from $20.00 it shows in red text that you will earn 170 points. This part is working correctly. However, on Step 2 of the check-out page it shows that you will earn 200 points. I also have "Allow Redeem of Reward Points on Order Total or Subtotal" set to subtotal, so that you won't earn points on S$H fees.

Am I missing another setting that needs to be fixed?

let me start with the fact that I really like this mod.
I installed it on my test server and the only fault I can find is this one. has there been a fix to this as I can't seem to find on in this thread.

but very nice work on everything else :bigups:

16 Nov 2008, 10:18 PM
#588
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

StarBuck:

let me start with the fact that I really like this mod.
I installed it on my test server and the only fault I can find is this one. has there been a fix to this as I can't seem to find on in this thread.

but very nice work on everything else :bigups:

I'll check this out in the morning- Thanks for the heads up.

17 Nov 2008, 1:59 AM
#589
avenuebeads avatar

avenuebeads

New Zenner

Join Date:
Aug 2006
Location:
Chicago IL
Posts:
80
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

I just installed this mod but I seem to have done something wrong. No sideboxes are showing that can be enabled in the layout boxes controller. And I have one error message in the listings

Warning: Missing argument 2 for zen_round() in /home/content/a/v/e/avenuebeads/html/includes/functions/functions_general.php on line 174
2 reward points

Any ideas?

17 Nov 2008, 2:24 AM
#590
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

AvenueBeads:

I just installed this mod but I seem to have done something wrong. No sideboxes are showing that can be enabled in the layout boxes controller. And I have one error message in the listings

Warning: Missing argument 2 for zen_round() in /home/content/a/v/e/avenuebeads/html/includes/functions/functions_general.php on line 174
2 reward points

Any ideas?

"Search This Thread", a handy little tool at the top of the page LOL yields a similar problem to yours....click here and read from post 515 forward, and you might find a solution, least I hope you do lol good luck :D

17 Nov 2008, 2:39 AM
#591
avenuebeads avatar

avenuebeads

New Zenner

Join Date:
Aug 2006
Location:
Chicago IL
Posts:
80
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Eeeek now I noticed an error in the modules section

Fatal error: Call to a member function on a non-object in /home/content/a/v/e/avenuebeads/html/includes/modules/order_total/ot_gv.php on line 29

17 Nov 2008, 3:45 AM
#593
avenuebeads avatar

avenuebeads

New Zenner

Join Date:
Aug 2006
Location:
Chicago IL
Posts:
80
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

OK, never mind found the files. Had some hiding on me :)

Still have the fatal error in the order total modules though.

Joe

17 Nov 2008, 4:14 AM
#594
neteasy avatar

neteasy

Zen Follower

Join Date:
Mar 2004
Location:
Ontario, Canada
Posts:
128
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

Andrew, thanks for the great module.

I upgraded from v1.13a to v1.20a and the Paypal order still doesn't generate reward points (user didn't return to the shop after the payment)... other payment works fine.

where is the code that trigger the reward point when Paypal order created?

17 Nov 2008, 6:11 AM
#595
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Try going into your PP account profile settings, Website Payment Preferences, and activating the PDT Token, grab the code and add it to your PP module in admin, hopefully you should see the points start being generated then :)

17 Nov 2008, 9:04 AM
#596
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

AvenueBeads:

I just installed this mod but I seem to have done something wrong. No sideboxes are showing that can be enabled in the layout boxes controller. And I have one error message in the listings

Warning: Missing argument 2 for zen_round() in /home/content/a/v/e/avenuebeads/html/includes/functions/functions_general.php on line 174
2 reward points

Any ideas?

Try the version off of my website: http://www.omnicia.com/Zencart%20Reward%20Points%20Module.zip

There are a couple of bug fixes in this version which are not yet in the Download Contribution section. I'm hoping to have a new version posted here sometime this week.

17 Nov 2008, 8:48 PM
#597
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

AvenueBeads:

Eeeek now I noticed an error in the modules section

Fatal error: Call to a member function on a non-object in /home/content/a/v/e/avenuebeads/html/includes/modules/order_total/ot_gv.php on line 29

Thats the Gift Voucher module- The Reward Point module does not modify or replace this so your problem has come from somewhere else.

17 Nov 2008, 8:57 PM
#598
neteasy avatar

neteasy

Zen Follower

Join Date:
Mar 2004
Location:
Ontario, Canada
Posts:
128
Plugin Contributions:
2

Re: Reward Points Module for ZC v13x

christon26:

Try going into your PP account profile settings, Website Payment Preferences, and activating the PDT Token, grab the code and add it to your PP module in admin, hopefully you should see the points start being generated then :)

thanks Christon. I had PDT token setup in Admin but Paypal order didn't add reward points... also tried the new version Andrew just posted but with no luck. :(

17 Nov 2008, 9:09 PM
#599
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Re: Reward Points Module for ZC v13x

christon26:

Try going into your PP account profile settings, Website Payment Preferences, and activating the PDT Token, grab the code and add it to your PP module in admin, hopefully you should see the points start being generated then :)

Question- Do you have Points rewarded by Product or Points rewarded by Total/Subtotal set?

17 Nov 2008, 9:18 PM
#600
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Reward Points Module for ZC v13x

Andrew,

Thanks for this great mod. When you time permits can you please post the preferred configuration settings? i.e. order total versus sub-total and why a shop owner might want one versus other. I know this is really a business decision but somehow I have a feel that some settings create less headaches just reading from all the posts.

I am going to download the updated version from your site and try that one as we would like to offer this for Christmas shopping.