Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Search For Products With Individually Assigned Reward Points? Rate Topic   - - - - -

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1001 posts

Posted 14 June 2016 - 05:32 PM #1

In our store, we have several user groups with different discount levels. 
We used to only have two payment dependent user groups: one for Paypal and one for the rest with several discount levels and implemented a rather low discount for the Paypal user that subtracted the fee PP charges.

Faithful Paypal users get upgraded to a higher discount but that doesn't take into account they are using Paypal.

 

Recently we had to create a separate group for these 'faithful PP-customers' to discern them from the rest.

 

Now we have a problem: ALL products that have individual reward points assigned (as %) need to be edited because the default amount is 0 ! 

 

Is there a way to quickly determine which products have these *individually set* reward points other than going through each product individually? 

I do have a spreadsheet 'telling' me which products should be in that 'individual list'.
However, each time a product goes on a vast sale, the reward points are set to zero and then turned back on after the sale is over.. it has happened quite a few times that I've forgotten and only noticed a long time afterwards, so a search option would be very welcome!

 

 

TIA

 

Yvana


running CS Cart V4.10.3.SP1 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21741 posts

Posted 20 June 2016 - 08:24 AM #2

Do you mean the "Override global PER" setting?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1001 posts

Posted 20 June 2016 - 09:34 PM #3

No, the one below that one, but it is on the same tab. 

Points earned per product 
Override global/category point value for this product

running CS Cart V4.10.3.SP1 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21741 posts

Posted 23 June 2016 - 01:06 PM #4

Some small changes in PHP are required. Please do the following:
 
open/create the app/addons/my_changes/init.php file with the following code:
<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
    'get_products'
);

Then open/create the app/addons/my_changes/init.php file with the following code:
<?php

 
function fn_my_changes_get_products($params, $fields, $sortings, &$condition, $join, $sorting, $group_by, $lang_code, $having) { if (!empty($params['is_op'])) { $condition .= db_quote(' AND products.is_op = ?s', $params['is_op']); } }
Please make sure that My changes addon is installed and activated. After that you will be able to search products by adding the '&is_op=Y' parameter to the URL. For example in this way: yourwebsite.com/admin.php?dispatch=products.manage&is_op=Y
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21741 posts

Posted 23 June 2016 - 01:07 PM #5

<?php
 
function fn_my_changes_get_products($params, $fields, $sortings, &$condition, $join, $sorting, $group_by, $lang_code, $having) 
{ 
    if (!empty($params['is_op'])) { 
        $condition .= db_quote(' AND products.is_op = ?s', $params['is_op']); 
    } 
}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 1001 posts

Posted 23 June 2016 - 07:45 PM #6

Hi

 

I am a bit puzzled by the offered solution.

 

You state at first that I have to make sure the my_changes addon is installed / enabled, which it is by the way. Then I must create or a mend the init.php file in the directory /app/addons/my_changes/ and add the following code if not present or if file is not present

<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
'get_products'
);

Save the file and then edit the same init.php file and add the following code to the file:

<?php
 
function fn_my_changes_get_products($params, $fields, $sortings, &$condition, $join, $sorting, $group_by, $lang_code, $having) 
{ 
    if (!empty($params['is_op'])) { 
        $condition .= db_quote(' AND products.is_op = ?s', $params['is_op']); 
    } 
}

Is this correct ? Cause when I do this the store cannot be reached at all.

 

However when the init.php just contains the code above then the url

admin.php?dispatch=products.manage&is_op=Y  does give you list however with also products that do not have the PER override enabled 

 

See this screenshot 

 

Attached File  screenshot-override-per.jpg   39.4KB   0 downloads

 

Why is that ? clearing the cache  (cc&ctpl) did not give me the desired result of just products where the PER was enabled but also the disabled ones.

 

What could I have missed here ?

 

 

 

 


running CS Cart V4.10.3.SP1 


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3966 posts

Posted 23 June 2016 - 09:11 PM #7

The second file with the function should be /app/addons/my_changes/func.php



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21741 posts

Posted 24 June 2016 - 01:48 PM #8

Yes, thank you The Tool. The second part of code should be placed to /app/addons/my_changes/func.php file. I am sorry for my mistake. Once again in order to be clear:

 

/app/addons/my_changes/init.php file:

<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
    'get_products'
);

/app/addons/my_changes/func.php file:

<?php
 
function fn_my_changes_get_products($params, $fields, $sortings, &$condition, $join, $sorting, $group_by, $lang_code, $having) 
{ 
    if (!empty($params['is_op'])) { 
        $condition .= db_quote(' AND products.is_op = ?s', $params['is_op']); 
    } 
}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)