Post by Aminur » Sat Jan 09, 2016 8:51 am

Hi
I am new to opencart and I have some questions.
1) When clicking on show all XXXX under categories sub menu why does it not show all the products in that category
So when clicking on http://demo.opencart.com/index.php?rout ... ry&path=20 I would expect to see 1 mac after the bit where it says refine search. I just see 12 products.

2)Can I change the default view to list view by changing a value in admin screens (or even a value in the database table).

3)Is there an extension to remove the the sort by and show drop downs. It takes up precious space on mobiles.

4)Is there a simple way of removing the image box on list view. Again I don't want to waste space with images. I've set image sizes to 1 in admin screen, but I'm left with big blank space on the left in grid view - not very responsive design in that the image box doesn't shrink with image size.
That's all for today.
Thanks

Newbie

Posts

Joined
Sat Jan 09, 2016 8:35 am

Post by IP_CAM » Sun Jan 10, 2016 2:19 pm

1. Sub Category Images
http://www.opencart.com/index.php?route ... y%20Images

2. Search for a ADMIN Switchable VqMod, or switchable Module, to set ADMIN DEFAULT Value:
http://www.opencart.com/index.php?route ... %20Default

3. Unaware of such an Extension, in my Open Cart v.1.5.6.5_rc:
openshop.li\cart\catalog\view\theme\default\template\product\category.tpl,
those two sections have to be removed, either by VqMod, or on Source, to make it work:

Code: Select all

<div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>

Code: Select all

<div class="sort"><b><?php echo $text_sort; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
4. List View without Image, below lines have to be removed, either by VqMod, or on Source, to make it work:
No image made for this! IN THIS SECTION:

Code: Select all

  <div class="product-list">
    <?php foreach ($products as $product) { ?>
those lines have to be removed:

Code: Select all

<?php if ($product['thumb']) { ?>
      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
      <?php } ?>
If you remove so much Code out of the Category.tpl File, other Category.tpl - related OcMod/VqMod driven
Extensions may NOT LONGER function!

Good Luck ;)
Ernie
PS: DO NOT argue, that this code would not fit your OC Version and/or theme, since you never mentioned any... ::)

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Aminur » Sun Jan 10, 2016 7:41 pm

Ernie
Thanks for your response. I'm just using the default template (v2.1.0.1) at the moment to try and get a understanding of the system. I'll look into the code suggestions that you've provided, but I have no experience of php (I do have .net mvc experience though).

More reading is required I think.

Newbie

Posts

Joined
Sat Jan 09, 2016 8:35 am

Post by IP_CAM » Mon Jan 11, 2016 11:35 am

Strictly technically, you have to rework the same Sections, they are named similar, the only real difference is the 'responsive' CLASS-Coding, whereever it occurres. But if you have some fundamental Code-Knowledge, it should not be a problem after all. And next time, just mention your 'Baby', and it's 'Equipment', first, if you would have, you could have saved you time and work... ::)

Good Luck anyway!
Ernie
openshop.li/cart/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Aminur » Tue Jan 12, 2016 1:03 am

Ok Ernie,
Didn't fully understand your last post about babies and equipment's! but I've been busy reading and learning how to create OCMOD and creating templates.

So I created a theme called fastfood, put the category.tpl in the right place. Installed a existing ocmod (remove wishlist and compare) against this tpl. Went to edit fastfood\template\product\category.tpl. Edited the files as you suggested. No effect. Is this because after I installed an ocmod on this file, this file is now always read from the database.

Assuming this is correct. Do I now need to create an ocmod (lets call it remove-default-sort-box.ocmod.xml) with your suggestions. If I successfully install my new ocmod...you wrote ....
>>If you remove so much Code out of the Category.tpl File, other Category.tpl - related OcMod/VqMod driven
>>Extensions may NOT LONGER function!
Is this still correct, or does this statement not apply to ocmods only direct file edits.

I hope what I've said makes some sense.
Thanks

Newbie

Posts

Joined
Sat Jan 09, 2016 8:35 am

Post by Aminur » Tue Jan 12, 2016 1:22 am

I think I am about to walk into opencarts equivalent of microsofts dll hell problem https://en.wikipedia.org/wiki/DLL_Hell with this ocmod and file editing stuff.
Don't normally use smilies but this wanrrants it. :crazy:

Newbie

Posts

Joined
Sat Jan 09, 2016 8:35 am

Post by IP_CAM » Tue Jan 12, 2016 3:07 am

An OcMod/VqMod uses some default OC File content, to act as ANCHOR/Tag, kind of, to add/replace/remove 'something' with it's own Content, thereby creating a NEW File, cached, and consisting of the Default File Source, modified with the content of the Extension.

Then, depending of the NEW File Content, another OcMod/VqMod possibly will not longer be able to find it's ANCHOR, as expected, because the LATER Mod will use the LATEST cached/modified File, already changed by the FORMER Extension, and so possibly NOT LONGER containing the ANCHOR/Tag, in EXACTLY the same Form, as required by the LATER Extension, to do it's own Job.

It's like you going to work, and the Fellow, entering the Door before you, changes the Lock. So, you still have a key, but it don't match the Lock anymore, and you just cannot longer go to work ... :choke:

More, OC-2 has/uses on it's own Overwrite/Override-way of doing Things, called OcMod. It was planned to replace FORMER Way's of doing such, and it does it a little differently too, compared with VqMod, it's ancestor, and this Fact add's to problems, by Nature of things, because neither one is aware, by default, that the other One even exists.
One reason, Microsoft kept it's (hidden) DOS, up the the latest Win Version, just in case ... 8)

But since OC is an open System, everyone can do, what one likes to do. With all the consequences, possibly related with such Doings. So, take it, use it, or leave it, the One or the Other, it's your own decision. It will NOT harm anything, it just make's it a little more complicated, timewise, for the Server, because it has to create multiple FInal OUTPUT Files, the first one's for the OcMod, and the second, taken from the OcMod Final Output Temp file, to create a final range of VqMod Output TEMP Files, to then be used, to create the final OUTPUT Content, to be sent to the Visitor. Just, do NOT wonder about slower Server REACT Values, it takes much longer, until the Server even starts to send out data, as I can see on my own test Results.

Sound complicated ? It is, at least, to understand, strictly technically. But since today's Servers have a lot of Power, you won't feel it, usually, exept for the Response-Delay, this new kind of 'multiple redesign of the wheel'.... :D

But I don't plan to sound critical, in any way, it's not my Problem, after all. Because, in a real FINAL OC Version, I would probably use neither one, if I would plan to create a TOP NOTCH piece of Shop Software, without any Brakes, or repeating LOOPS, planned to most efficiently do it's Job, the only really CLEAN and DIRECT Way of doing such.

But this is only my very personal view on this, coming from the Perl Auction Coder Scene, and a time, where no single Byte was wasted, in order to get top performance.

Ernie ;)

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 9 guests