Jump to content

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

Your Add-On Needs A New Hook In Cs-Cart. Post It Here. Rate Topic   * * * * * 1 votes

 
  • sioulisn
  • Junior Member
  • Members
  • Join Date: 06-Apr 09
  • 94 posts

Posted 15 November 2021 - 05:29 PM #181

Can you send us the YouTube channel name that we can see the screencasts?

 

Posted 16 November 2021 - 08:18 AM #182

Hello,

 

I need a hook 

 

fn_set_hook('check_master_products_add_to_cart_post', $cart, $product, $product_id, &$result);

 

We have to add the conditions like Vendor Debt Payout.

function fn_master_products_check_add_to_cart_post($cart, $product, $product_id, &$result)
{
    if (!$result
        || (Registry::get('addons.vendor_debt_payout.status') === 'A'
        && !empty($product_id)
        && (int) $product_id === fn_vendor_debt_payout_get_payout_product())
    ){
        return;
    }
    
    $product_company_id = db_get_field('SELECT company_id FROM ?:products WHERE product_id = ?i', $product_id);
    $result = !empty($product_company_id);
}


 
  • maimai
  • Member
  • Members
  • Join Date: 07-Aug 21
  • 35 posts

Posted 23 January 2022 - 05:52 AM #183

Hello all,

 

I have made some change on this hook to workaround my needs. what you have provided is, like this;

 

    fn_set_hook('get_banners', $params, $condition, $sorting, $limit, $lang_code, $fields);
 

cs-cart standard is always include the $join field on hooks on products, categories, companies, pages and more. the $join field is not included on banners addon's get_banners hook. so please make it like this;

 

    fn_set_hook('get_banners', $params, $join, $fields, $condition, $sorting, $limit, $lang_code);
 
I just changed the code lines and moved the $join field before the hook to set to get achieve my needs. it would be better for cs-cart to change it, so addon developers will not waste their time in future to check it.
 
Thanks!