WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Influence the order of article options
  • Print
Pages: [1]   Go Down

Author Topic: Influence the order of article options  (Read 4036 times)

Offline Erwinvb

  • Posts: 11
  • Gender: Male
Influence the order of article options
« on: September 19, 2015, 10:59:22 PM »
Is there a way to influence the order in which the article options are shown in the select on the pages.
I can't seem to understand in which way they are sorted.

Thanks in advance
Logged

freeSbee

  • Guest
Re: Influence the order of article options
« Reply #1 on: September 20, 2015, 10:08:52 AM »
Hi Erwinvb

Bakery does not support ordering of option attributes by default.
But try this workarround:


WARNING:
1. This will only work properly before assigning any product attributes. For instance if you have already assigned attribute pricing it will be messed after reordering the attribute names.
2. These modifications will affect all Bakery option attributes, not only the ones given in the example below. All option attributes will be ordered the same like the attribute_id.



1.
First go to the mod_bakery_attribut es table in your database and reorder the attribute_name field in your own way.

For example:

attribute_id        option_id         attribute_name

     6                      2                        XXL
     7                      2                        L
     8                      2                        S
     9                      2                        XL
   10                      2                        M


Change db table to, eg.:

attribute_id        option_id         attribute_name

     6                      2                        S
     7                      2                        M
     8                      2                        L
     9                      2                        XL
   10                      2                        XXL


2.
Open the files view_overview.php and view_item.php. If you need the same ordering in the backend too, open modify_item.php and modify_options.php as well. Replace the code snippets (all in all 5 times)
Code: [Select]
ORDER BY o.option_name, LENGTH(a.attribute_name), a.attribute_name ASC
by
Code: [Select]
ORDER BY a.attribute_id ASC

Regards Christoph
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Influence the order of article options
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2