Jump to content

Menu shortcuts


windsurfer

Recommended Posts

The items in the dropdown menu are linked to products, when i select an item it doesn't go directly to the item but to a page that shows the item image which is not a shortcut but the the image below which is a shortcut goes to the product. Is there no way to directly have the link in the dropdown menu go to the product listing ?

image.png.8e1fb5d32692b00d2cc75f192b5000cc.png

Link to comment
Share on other sites

The listing should be links to product "Categories". The View Category page can have an image dedicated to that category which is also one of the products in that category. (I recall there being a version of CubeCart, or maybe a particular skin, or perhaps a code snippet, that did this automatically.)

Recent versions of CubeCart will automatically send the visitor to that View Product page if a "Search" results in only one product found in that search, but (currently) not for getting a listing of a category of products, or a list of items on sale.

There may be a plugin that will give the admin a storefront "menu" of a custom criteria, such as selected products based on something (other than Featured or Best Sellers).

Link to comment
Share on other sites

Hi

Interesting you should say that the items listed point to a subcategory, thing is i don't have any category or subcategory with those names so i still don't understand why it wouldn't go to the product page. Doesn't make a lot of sense to me really. 

Link to comment
Share on other sites

You are saying that you have not created a category with the name Mobile Accessories. Nor having created any categories with the names iPhone Charging Cables or USB-C Charging Cables.

I would be interested in viewing your store.

Link to comment
Share on other sites

cat_id
 1 = empty
 2 = mobile-accessories
 3 = empty
 4 = 2/iphone-charging-cables
 5 = 2/usb-c-charging-cables
 6 = 2/usb-c-audio-adapter
 7 = medical-masks
 8 = screen-protecors (sic)
 9 = micro-usb-charging/data-cable-c9
10 = mobile (404)
11 = empty
12 = empty
13 = empty
14 = empty
15 = empty

Category 9 is odd because the breadcrumbs show that it is a child of category 2, yet the URL for it does not include the derived path of category 2 (like how categories 4, 5, and 6 do).

In admin, Categories, the category name "Mobile Accessories" (cat 2) should be a link that, when clicked, will show the list of cat 2's children. What shows here?

In admin, Staff Access Log, Staff Activity tab, actions are logged for the past thirty days. Is there a log entry for having created categories? (It probably won't say the ID of the category.)

I am wondering, however, if there is a real knock-on effect of having product names with slashes as a character. I will need to look into that.

Link to comment
Share on other sites

www.usbc.ca

image.png.0682598765d11ad32e29c4ef31c10cde.png

There are some categories created within the past 30 days yes.

What i did now was create a category called test category

I created 2 product called test product 1 and 2 and assigned them to the test category

Now the test category doesn't drop down but when i select it the 2 products show up and i can select them. This a little different from the mobile accessories. 

 

 

image.png

Link to comment
Share on other sites

Clicking on the words "Mobile Accessories" in the Categories table above, what do you see next?

I will assert that CubeCart does believe that "USB-C Audio Adaptor" is a category, it is a child of "Mobile Accessories", and there are four inventory items (four of the six screen protectors) that have this category tagged as an 'additional' category (when editing a product, Categories tab).

Could it be what you say that the USB-C Audio Adapter is, in fact, a product -- this item of inventory was imported from a CSV file? Was CubeCart's "Import Catalogue" feature ever used for this store?

Link to comment
Share on other sites

Clicking on the words "Mobile Accessories" in the Categories table above, what do you see next?

That is, in admin, Categories, the Categories table you attached to your post above, the words in that table to be clicked on. (I am not referring to the storefront.)

Link to comment
Share on other sites

Ya i guess i did make those subcategories.

Like i said about the test products. I don't understand why when i assign a product to a category that category doesn't flyout and take me to the product. Makes no sense to me.

Link to comment
Share on other sites

Recent versions of CubeCart will automatically send the visitor to that View Product page if a "Search" results in only one product found in that search, but (currently) not for getting a listing of a category of products, or a list of items on sale.

We can make that happen for a category (and sale items).

The store owner may wish to provide additional general information about the type of products in this category that would be tedious to replicate across all (future additional) products in this category. As such, perhaps a setting in admin on a general or per-category basis to allow this "go to product if only one found" feature.

I'll make some preliminary investigations.

Link to comment
Share on other sites

Not sure if this exactly what you are wanting (wants something involving that a link to a product be listed mixed in with the list of categories).

The following edits: adds an admin choice to enable the following new behavior, such that if a category (including Sale Items) has only one valid product in it, jump to showing that product's page, redirecting away from the category page that would show that one product.

In classes/catalogue.class.php, near line 1979, find:

                if (($category = $this->getCategoryData((int)$search_data)) !== false) {
                    if (($products = $this->getCategoryProducts((int)$search_data, $page, $per_page)) !== false) {
                        $this->_category_products = $products;

Add after:

if ($page == 1 && count($this->_category_products)==1 && $GLOBALS['config']->get('config', 'product_jump_to')) {
    $pid = current($this->_category_products)['product_id'];
    $GLOBALS['gui']->setNotify("Showing the only product in this category.");
    httpredir($GLOBALS['seo']->buildURL('prod',$pid));
}

Then, near line 2032, find:

                    foreach ($GLOBALS['hooks']->load('class.catalogue.search_catalogue.sale_items.post') as $hook) {
                        include $hook;
                    }

Add after:

if ($page == 1 && count($this->_category_products)==1 && $GLOBALS['config']->get('config', 'product_jump_to')) {
    $pid = current($this->_category_products)['product_id'];
    $GLOBALS['gui']->setNotify("Showing the only product on sale.");
    httpredir($GLOBALS['seo']->buildURL('prod',$pid));
}

For the admin setting:

In the admin skin template settings.index.php, near line 200, find:

         <div><label for="basket_jump_to">{$LANG.settings.basket_jump_to}</label><span><select name="config[basket_jump_to]" id="basket_jump_to" class="textbox">
            {foreach from=$OPT_BASKET_JUMP_TO item=option}<option value="{$option.value}"{$option.selected}>{$option.title}</option>{/foreach}
            </select></span>
         </div>

Add after:

<div><label for="product_jump_to">Jump to product if only one found</label><span><select name="config[product_jump_to]" id="product_jump_to" class="textbox">
{foreach from=$OPT_PRODUCT_JUMP_TO item=option}<option value="{$option.value}"{$option.selected}>{$option.title}</option>{/foreach}
</select></span>
</div>


In the admin source script settings.index.inc.php, near line 407, find:

$select_options = array(
    'admin_notify_status'	=> $a_n_s,
    'basket_jump_to'  => null,

Add after:

'product_jump_to' => null,

Now, in admin, Store Settings, Layout tab, Layout Settings section, a new option "Jump to product if only one found" can be set No or Yes.

 

Link to comment
Share on other sites

That indeed takes me to the product listing when there is a product assigned to that category. Thank you.

I do have a category called Test Category and i assigned 2 products to that category, it would be nice if the category would expand when i mouse over it just like the mobile accessories does.

Link to comment
Share on other sites

Please recall that what was thought to be products were actually sub-categories.

Wanting to expand a category to show all the products assigned to that category within the "Shop by Category" navigation menu could cause that menu to expand to ridiculous lengths.

But we can give it a shot.

Link to comment
Share on other sites

The following edits will show a list of the names of assigned products after the list of the names of sub-categories for a given category, in the main navigation menu.

In /classes/catalogue.class.php, near line 807, find:

$sql = 'SELECT C.`product_id`, I.`use_stock_level` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` AS C INNER JOIN `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` AS I ON I.`product_id` = C.`product_id` WHERE C.cat_id = '.$category['cat_id'].' AND I.status = 1';

Change to:

$sql = 'SELECT C.`product_id`, I.`use_stock_level`, I.`name` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_category_index` AS C INNER JOIN `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` AS I ON I.`product_id` = C.`product_id` WHERE C.cat_id = '.$category['cat_id'].' AND I.status = 1';


Then, near line 858, find:

if ($GLOBALS['config']->get('config', 'catalogue_expand_tree') && $children = $this->getCategoryTree($category['cat_id'], $level)) {
    $result['children'] = $children;
}

Add after:

if ($products) { foreach ($available_products as &$ap_product) { $ap_product['url'] = $GLOBALS['seo']->buildURL('prod', $ap_product['product_id']); } $result['available_products'] = $available_products; }
In the Mican skin template element.navigation_tree.php, find the last line:

</li>

Above that, add:

{if isset($BRANCH.available_products)}
<ul>
{foreach $BRANCH.available_products as $available_product}
   <li><a href="{$available_product.url}" title="{$available_product.name}">{$available_product.name}</a></li>
{/foreach}
</ul>
{/if}

Trying this with the Foundation skin requires some extra HTML as well as some custom CSS rules. I haven't 100% solved that just yet.

Have CubeCart clear it's internal cache.

Link to comment
Share on other sites

For the Foundation skin, rename the existing skin template element.navigation_tree.php to element.navigation_tree_original.php, and create a new file as follows:

Name: element.navigation_tree.php
Contents:
{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2017. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
<li class="has-dropdown">
   <a href="{$BRANCH.url}" title="{$BRANCH.name}">{$BRANCH.name}</a>
   {if isset($BRANCH.children) or isset($BRANCH.available_products)}
   <ul class="dropdown">
      <li itemprop="name"><label itemprop="url" content="{$BRANCH.url}" rel="{$BRANCH.url}">{$BRANCH.name}</label></li>
      {$BRANCH.children}

{if isset($BRANCH.available_products)}
{foreach $BRANCH.available_products as $available_product}
      <li><a href="{$available_product.url}" title="{$available_product.name}">{$available_product.name}</a></li>
{/foreach}
{/if}

   </ul>
   {/if}
</li>

Have CubeCart clear its internal cache. Then request the homepage of your site.

Link to comment
Share on other sites

Hi

That does seem to do what i was looking for.

I do like the mican template layout especially the vertical menu on the left, much more pleasant to look at. but it messes up the display of the product description, it puts the order now section below the description and it is not responsive , kind of unfortunate.

Thanks for the help though.

Link to comment
Share on other sites

  • 3 weeks later...

I have the mod applied so the item in the drop down menu will go directly to the product.

I have been trying to get some answers from Semperfiwebservices without much success but i am wondering if i apply the vertical category menu from them if that would affect the mod i applied to the category listing.

Does anybody know ?

Link to comment
Share on other sites

I've been playing with my own implementation of a vertical navigation bar (not complete), but the edits posted above seem to be independent of the skin template box.navigation.php - which is where all of my code and css classes take place to make the bar show vertically and behave appropriately. (Also, the template main.php to place the vertical bar in a left side panel.)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...