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

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

Posted 25 October 2017 - 02:15 PM #141

Hooks to functions will be added.
Regarding template hook. If you need to override all template why don't you use http://docs.cs-cart....hlight=override ?

 
There is no hook in the update.tpl which can be overrided. Override the whole template is not good way from my point of view

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 25 October 2017 - 08:24 PM #142

 

Hi Tony,

 

I see there 

{hook name="orders:totals"}
{/hook}

Right after the shipping line. I suppose you need the hook you've described because you want to display a row before the shipping info?

I created a task for this hook. Also we will add hook for tax row. Will let you know when its finished.

 

 

Yes, this particular customer wanted their internal customer_id and PO number displayed above the shipping info.  Right now I have the template "override'ed to add this an some other content.  But with this hook I can remove the override.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2034 posts

Posted 26 October 2017 - 07:08 AM #143

 
There is no hook in the update.tpl which can be overrided. Override the whole template is not good way from my point of view

In both cases you will override the whole template. I see no difference here.

Probably you can say the exact place you need to modify.


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

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

Posted 26 October 2017 - 08:44 AM #144

In both cases you will override the whole template. I see no difference here.

Probably you can say the exact place you need to modify.

 

Sure, we can extend static data with extra parameters with schema in addon. But only the following types of parameters are supported now:

 

- hidden

- checkbox

- megabox

- select

- input

 

Sometimes it is required to use other parameters like files, multiple checkboxes, additional images and so on


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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • avoronin
  • CS-Cart Team
  • CS-Cart Architects
  • Join Date: 23-Oct 17
  • 2 posts

Posted 31 October 2017 - 04:34 AM #145

Hello, Tony.

 
The following hooks will be added in the next version of CS-Cart:
orders:invoice_taxes
orders:invoice_shipping

 



 
  • alagoda
  • CS-Cart Team
  • CS-Cart Architects
  • Join Date: 03-Jul 17
  • 1 posts

Posted 02 November 2017 - 11:56 AM #146

Hello,
 
Here are the hooks that we have added to the next CS-Cart version: https://gist.github....be78b6d815c5cab


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 03 November 2017 - 11:12 PM #147

Please add a hooks to the produts/update.tpl page for all of the tab areas that do not currently have hooks surrounding them. These hooks should be inside the containing div just like you've done for the SEO tab.  The most notable one at the moment is the Shipping settings section that has no hook in update.tpl nor in the underlying products_shipping_settings.tpl file.

 

I'm going to add the hook "products:update_shipping_settings" to my customer site so please use the same name or advise me if you choose differently.

My usage is to add some packaging descriptions to the shipping_settings so as to allow for repackaging products using the Shippings hooks.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


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

Posted 26 February 2018 - 07:02 AM #148

I would like to gauge the interest in potentially adding a CoinPayments cryptocurrency shopping cart plugin that would allow merchants and suers to transact in over 125 different digital currencies. We offer support for all of the major altcoins and currently have over 700,000 vendors worldwide.

 

We have already integrated your system with CS-Cart

 

https://www.ecom-lab...or-cs-cart.html


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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 23 March 2018 - 06:10 PM #149

Please add a hook to the google_export addon in func.php so we can alter the '$fields' array.  Seems the gtin entry was modified to default to the product_code.  I have a customer who wants it left blank if they've not entered/imported it.  Rather than modifying the core file by commenting out the db_field value and having to remember this for each upgrade, would prefer a hook where I can unset that array element (or map it to something else).


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • mschekotov
  • Architect
  • CS-Cart Architects
  • Join Date: 06-Aug 15
  • 11 posts

Posted 27 March 2018 - 11:00 AM #150

Hello tbirnseth.

 

The $fields variable you've mentioned is used only when installing the Google Export add-on to populate the default "Google base" data feed.

 

If you don't want the gtin field passed to the product feed, it can be removed on the data feed editing page on the "Fields mapping" tab:

post-25130-0-33641400-1522148343.png

 

Can you please clarify, when exactly do you want to unset/remap gtin to something else?

Attached Files


Michael Schekotov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 27 March 2018 - 11:09 PM #151

My client has exceptions on Google and if the GTIN is empty, those exceptions are used.

There's no reason to force it to initialize with the product codes requiring all that data to be cleaned.

For those who want to map it to product_code, they can easily do so which would be the same as the initialization to the data in product_code..

 

As it stands now it is silently initialized to the product_code.

 

It could be an option to do so or simply left as either a text field (empty by default) or a mapped field.

 

But auto-filling it should be able to be disabled.

 

Given this can affect others is why I suggested it as a hook.  I would simply unset the 'db_field' element for my client.  For now, I have to comment it out.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • relmax
  • Newbie
  • Trial users
  • Join Date: 30-Mar 18
  • 1 posts

Posted 30 March 2018 - 02:53 PM #152

To avoid modifications of CS Cart kernel we suggest adding the following hooks to the code:

 

Update #1

File: app/controllers/frontend/categories.php

Raw (approx): 100

Replace code:

fn_gather_additional_products_data($products, array(

'get_icon' => true,

'get_detailed' => true,

'get_additional' => true,

'get_options' => true,

'get_discounts' => true,

'get_features' => false

));

 

with:

$options = array(

'get_icon' => true,

'get_detailed' => true,

'get_additional' => true,

'get_options' => true,

'get_discounts' => true,

'get_features' => false

);

fn_set_hook('categories_gather_products_data_pre', $products, $options);

fn_gather_additional_products_data($products, $options);

 

We use this modification to display product characteristics in a template.

 

Update #2

File: app/functions/fn.cart.php

Raw (approx): 1568

Function: function fn_finish_payment($order_id, $pp_response, $force_notification = array())

 

Update code:

if (!empty($pp_response['order_status'])) {

fn_change_order_status($order_id, $pp_response['order_status'], '', $force_notification);

}

db_query("DELETE FROM ?:order_data WHERE order_id = ?i AND type = 'S'", $order_id);

 

With the hook after db query:

if (!empty($pp_response['order_status'])) {

fn_change_order_status($order_id, $pp_response['order_status'], '', $force_notification);

}

db_query("DELETE FROM ?:order_data WHERE order_id = ?i AND type = 'S'", $order_id);

fn_set_hook('finish_payment_post', $order_id, $pp_response, $force_notification);

 

This hook can be used when the order status has to be changed to appropriate value after receiving payment.



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 405 posts

Posted 04 April 2018 - 06:28 AM #153

Hello,

 

There is no way to modify the smarty plugins without making a core modification. It would be great if instead of setting the entire plugins directory, a list of files could be retrieved. Take a look:

 

    $smarty_plugins_dir = $view->getPluginsDir();
    $view->setPluginsDir(Registry::get('config.dir.functions') . 'smarty_plugins');
    $view->addPluginsDir($smarty_plugins_dir);

    Change into:

    $smarty_plugins_dir = $view->getPluginsDir();
    $plugins = scandir(Registry::get('config.dir.functions') . 'smarty_plugins');

    fn_set_hook('smarty_load_functions_pre', $plugins, $smarty_plugins_dir);

    // Write functions to a cache folder and add that folder?
    // Or use a schema and register all the functions with function names, however, the schema function must be altered for that as you can not call the schema function in this state

    foreach ($plugins as $plugin) {
       $view->register_function($type, $plugin, 'php_callback'); // When calling plugins like this you will have to provide the function name
    }

PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • sitmgreg
  • Advanced Member
  • Members
  • Join Date: 01-Jun 16
  • 56 posts

Posted 13 April 2018 - 08:30 PM #154

we need a hook for overriding / extending error messages.

 

I think the right place for this is fn_init_error_handler

 

Basically it would be good to be able to control what happens during errors.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 13 April 2018 - 11:36 PM #155

Might not be the right place to ask, but if there's no answer, would like a hook to be added.

 

What hook would be used where a parent order would be accessed in the checkout process AFTER all the suborders are created?

 

Ideally there would be a place_order_post hook just ahead of the

return array($order_id, $action != 'save');

line in fn_place_order.

 

My goal is to identify if I'm the parent and then to split a fee across the suborders.  I.e. if I have a fee of $10 and there are 5 suborders (5 vendors) then I's want to spread the $10 across the 5 suborders at $2 each.

 

I guess I could do this from the checkout controller for the 'complete' mode and then just do my processing from there.  But that seems a bit awkward.

 

Update:

None of the existing hooks will do what I need to do.  I effectively need to be able to update the cart data for all orders (parent and suborders) before the notifications are done.  I've found a way to do it, but it's not very clean and makes assumptions that I'd rather not make like "place order hook is called in order of parent then suborders with total number of suborders being determined by the 'product_groups' element of the parent order....  Sure be nice to have some kind of clean hook that I could modify the orders before notification is sent and to clearly delineate parent/suborders.


Edited by tbirnseth, 17 April 2018 - 11:24 PM.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 290 posts

Posted 14 April 2018 - 05:59 AM #156

What For : On admin area need product features filtering.

 

file: fn.catalog.php

 

under following function

function fn_get_product_feature_variants($params, $items_per_page = 0, $lang_code = CART_LANGUAGE)

under following code

$join = db_quote(" LEFT JOIN ?:product_feature_variant_descriptions ON ?:product_feature_variant_descriptions.variant_id = ?:product_feature_variants.variant_id AND ?:product_feature_variant_descriptions.lang_code = ?s", $lang_code);
    $condition .= db_quote(" AND ?:product_feature_variants.feature_id IN (?n)", $feature_id);
    $sorting = db_quote("?:product_feature_variants.position, ?:product_feature_variant_descriptions.variant");

need hook $join, $condition



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 290 posts

Posted 14 April 2018 - 06:01 AM #157

What For : need save payment gateway response  surcharge

 

file: fn.cart.php

 

under following function

function fn_update_payment_surcharge(&$cart, $auth, $lang_code = CART_LANGUAGE)

over following code

if (!empty($cart['payment_surcharge'])) {

need hook $cart, $auth



 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 290 posts

Posted 14 April 2018 - 06:03 AM #158

also fix turkish characters for seo conversion

 

File:  app/schemas/literal_converter/umlauts.php

 

add that codes end of file

"\xc5\x9f" =>'s',
"\xc5\x9e" =>'S',
"\xc4\x9e" =>'G',
"\xc4\x9f" =>'g',
"\xc4\xb1" =>'i',
"\xc4\xb0" =>'I',


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 290 posts

Posted 14 April 2018 - 06:04 AM #159

What for: need some changes about user fileds

 

File fn.users.php

 

under following function

function fn_get_profile_field_value($profile, $field)

over folowing code

return $value;

need hook $field, $value



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 18 May 2018 - 05:44 PM #160

Please add the following hooks to the category picker files (and the appropriate overrides in the new admin responsive theme).
 
File: pickers/categories/picker.tpl
At approximately line 102, please add this hook following the <th>{__("name")}</th> cell:
I.e.
 
 <th>{__("name")}</th>
{hook name="category_picker:manage_header"}{/hook}
 
And in file: pickers/categories/jt.tpl at approximately line 24 please add a hook to insert a cell as in:
        </td>
        {hook name="category_picker:manage_data"}{/hook}
        <td width="5%" class="nowrap">
        {if !$view_only || $show_only_name}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.