Jump to content

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

Add Shipping Methods Tab To Companies.update In Vendor Panel? Rate Topic   - - - - -

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 102 posts

Posted 03 June 2020 - 06:58 AM #1

Hello, I want vendors to be able to select their own shipping methods through the companies.update 'Shipping methods' tab. 

 

I was able to make the tab appear by changing app/controllers/backend/companies.php from this:

    if (!Registry::get('runtime.company_id')) {
        $shippings = db_get_hash_array(
            "SELECT a.shipping_id, a.status, b.shipping"
            . " FROM ?:shippings as a"
            . " LEFT JOIN ?:shipping_descriptions as b ON a.shipping_id = b.shipping_id AND b.lang_code = ?s"
            . " WHERE a.company_id = 0 AND a.status = 'A'"
            . " ORDER BY a.position",
            'shipping_id', DESCR_SL
        );
        Tygh::$app['view']->assign('shippings', $shippings);

        if (!fn_allowed_for('ULTIMATE')) {
            $tabs['shipping_methods'] = array(
                'title' => __('shipping_methods'),
                'js' => true
            );
        }
    }

to just a different if condition in the first line:

if (fn_allowed_for('MULTIVENDOR'))

So I got it to appear in the vendor panel, but it's not functional, meaning that if I check or uncheck a shipping method in the vendor panel, then it doesn't save for some reason. Why is this, and how can I fix it?



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

Posted 03 June 2020 - 01:36 PM #2

Your solution works on my local installation. I can enable and disable shipping methods under vendor account. Try to clear cache


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)