Post by roja123 » Tue Jun 18, 2019 3:19 pm

hi, i want to displaying the last child category in add product page for select the category. Please can anyone share u r answer to do.

New member

Posts

Joined
Mon Jun 17, 2019 3:08 pm

Post by cedcommerceteam » Tue Jun 18, 2019 4:08 pm

Hello roja,

You want only child categories to be displayed while adding product
Ex: Components > Monitors as Monitors

Please see attachment as well, once the requirement is clear then i can suggest you solution.

Thanks & Regards :

Attachments

categories.png

categories.png (14.41 KiB) Viewed 948 times


Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

Post by roja123 » Tue Jun 18, 2019 6:35 pm

like SALON -> WOMEN -> SKIN, here i need to display only SKIN category not for parents category.

New member

Posts

Joined
Mon Jun 17, 2019 3:08 pm

Post by cedcommerceteam » Wed Jun 19, 2019 6:41 pm

Hello roja,

Please add following code in an OCMOD file, if you want only child category to be displayed while add product

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<code></code>
	<name></name>
	<version></version>
	<author></author>
	<link></link>
	<file path="admin/controller/catalog/category.php">
      <operation>
       <search>
        <![CDATA[array_multisort($sort_order, SORT_ASC, $json);]]>
      </search>
      <add position="before" ><![CDATA[
          foreach ($json as $key => &$value) 
          {
		if(strpos($value['name'], ">") !== false)
		{
			$res = explode(">", $value['name']);
			$cat_name = end($res);
			$value['name'] = trim($cat_name);
		} else {
			$value['name'] = trim($value['name']);
		}
	  }
      ]]>
      </add>
    </operation>
  </file>
  </modification>
Add above code in a xml file and install that file changes will reflect in modification.

Please do share us the feedback.

Thanks & Regards :

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

Post by roja123 » Thu Jun 20, 2019 4:28 pm

its not working for me on opencart 3 there is no changes after uploading the above file.

New member

Posts

Joined
Mon Jun 17, 2019 3:08 pm

Post by cedcommerceteam » Mon Jun 24, 2019 6:06 pm

Hello roja,

This is a code when you add product & search for categories then only child category will be shown, this is what you needed?

Can you please share screenshot? Please once check your modification file as well, whether the code is modified or not.

Thanks & Regards :

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România
Who is online

Users browsing this forum: Amazon [Bot], Semrush [Bot] and 407 guests