News:

Support the VirtueMart project and become a member

Main Menu

Customize Sort By and Manufacturer

Started by quintonv, July 02, 2012, 13:58:46 PM

Previous topic - Next topic

quintonv

Hi

I have been able to customize a lot of the views in VirtueMart in order to integrate it with my current template. I am mostly just chaging the css classes being applied to div's ans spans.

I am trying to customize the html being written for the Sort By and Manufacturer views. I cannot seem to find the components that write the html, only the parts where they are called in the default.php of the Category view

            <div class="width70 floatleft">
               <?php echo $this->orderByList['orderby']; ?>
               <?php echo $this->orderByList['manufacturer']; ?>
            </div>

Which .php file renders the above orderByList function?

Thanks
Quinton

srajca

If you are mostly changing with css then find this in the css file
.orderlistcontainer div.activeOrder
For all elements try using Firebug if not already

quintonv

Thanks for the css tip, I customized already all I can with css only.

I have been using firebug, but still can't figure out which php file is rendering the 2 components, I wan't to change the physical div and the layout of the heading and drop down. I even opened every .php file in the virtuemart folder and searched for the html that firebug showed me, can't find it. That's why I asked which files are physically rendering those 2 statements in the first post.

srajca

i think you were looking in the wrong folder. Look in the category folder, I am 100% sure it is there. Then you can also play with the div's etc.

quintonv

The code I pasted is from the category folder, it only calls those functions, the code is somewhere else, that I can't seem to find :[

The divs are definitely not in that category folder

srajca

Quote from: quintonv on July 02, 2012, 13:58:46 PM
Hi

I have been able to customize a lot of the views in VirtueMart in order to integrate it with my current template. I am mostly just chaging the css classes being applied to div's ans spans.

I am trying to customize the html being written for the Sort By and Manufacturer views. I cannot seem to find the components that write the html, only the parts where they are called in the default.php of the Category view

            <div class="width70 floatleft">
               <?php echo $this->orderByList['orderby']; ?>
               <?php echo $this->orderByList['manufacturer']; ?>
            </div>

Which .php file renders the above orderByList function?

Thanks
Quinton
you can add/edit your div classes here and then apply your css rules/look. You can do anything in these 2 files. If this is not it then, what exactly are you looking for? What are you trying to accomplish/do?

quintonv

In the .PHP file the only code you see is

<div class="width70 floatleft">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>

But when it is finally rendered and viewed in the browser the two <?php echo statements generates the output below, it is that output that I need to manipulate. The divs below are not in the code above and not present in the php file either.

<div class="width70 floatleft">
  <div class="orderlistcontainer">
    <div class="title">Sort by</div>
    <div class="activeOrder">
      <a title=" +/-" href="/index.php/onlineshop/dj-equipment/cd-players-cdj-s2012-06-11-13-44-08/orderDesc">Product Name  +/-</a>
    </div>
    <div class="orderlist" style="display: none; ">
      <div>
        <a title="Product SKU" href="/index.php/onlineshop/dj-equipment/cd-players-cdj-s2012-06-11-13-44-08/by,product_sku">Product SKU</a>
      </div>
      <div>
        <a title="Category" href="/index.php/onlineshop/dj-equipment/cd-players-cdj-s2012-06-11-13-44-08/by,category_name">Category</a>
      </div>
      <div>
        <a title="Manufacturer name" href="/index.php/onlineshop/dj-equipment/cd-players-cdj-s2012-06-11-13-44-08/by,mf_name">Manufacturer name</a>
      </div>
      <div>
        <a title="Product price" href="/index.php/onlineshop/dj-equipment/cd-players-cdj-s2012-06-11-13-44-08/by,product_price">Product price</a>
      </div>
    </div>
  </div>
  <div class="orderlistcontainer">
    <div class="title">Manufacturer: </div>
    <div class="Order"> Pioneer</div>
    <div class="orderlist" style="display: none; "></div>
  </div>
  <div class="clear">
  </div>
</div>

srajca

ok, but what exactly are you trying to do?

quintonv

I want to rewrite some of those divs, change the layout, so that the drop down shows next to the title, instead of in a row below it, esentially I would like to only have one div for the title "sort by" and the drop down box.

srajca

unfortunately i do not know which file you would have to edit, maybe somebody from the team could help to show us where to look. Do share if you figure it out. Sorry I wasn't of any use.

quintonv


ofhouse

Hello,

the function you are looking for is getOrderByList()

It is located at /administrator/components/com_virtuemart/models/product.php

It is a bad Idea to edit this file directly but I think it would be possible to create a copy of this function and call it in your template.

quintonv

Quote from: ofhouse on August 15, 2012, 17:02:39 PM
Hello,

the function you are looking for is getOrderByList()

It is located at /administrator/components/com_virtuemart/models/product.php

It is a bad Idea to edit this file directly but I think it would be possible to create a copy of this function and call it in your template.

Thanks, I will give it a try and add it to my template :)

MarioP

Hello,
I refreshed the thread because I also would like to adjust the 'sort by' feature. Generally in category view, I use the sort by product name and product price options. But I have one category ( category of phased out, archival products, which are no longer available for sale) where the products don't have assigned prices. So, of course I don't need to use the 'sort by price' feature in that category. Is there any possibility to exclude that option from specific category? As far as I know it's impossible with VM standard back end options. Thus the best would be create template override for that category. If even, is that possible without changing any VM core files? Maybe someone solved the problem  -  I looked through the forum I noticed several topics concerning that issue, but unfortunatelly without answer :( So if someone could help in that matter...thank you in advance.