New Landing How can we help? Themeforest Theme Support Neighborhood Hardcoded sorting and pagination messes up our shop page

Viewing 11 posts - 1 through 11 (of 11 total)
  • #50511
    airuck
    Member
    Post count: 36

    Neighborhood 1.65

    http://support.swiftideas.net/forums/topic/remove-sorting/ is related to this issue. However, hiding the sort won’t work for me: I want to move it around so it doesn’t overwrite the content we have at the top of our shop page.

    So in archive-product.php, there’s no more reference to the woocommerce_before_shop_loop. Rather than using or overriding the woocommerce_catalog_ordering() and woocommerce_pagination() and woocommerce_result_count() functions, their contents are hard-coded.
    This means these can’t be customized by anyone trying to manipulate those hooks in child themes or local customizations in functions.php or whatever.

    The contents of those three methods are short and exist almost identically in the template. I assume this was something done hurriedly related to the woocommerce 2.1 updates, but can this be fixed so these things are customizable?

    I’m hoping to avoid overwriting the archive-product template for something relatively trivial, and then have to keep up with it in the future.

    Thanks for reading!
    -aaron

    #51285
    Melanie – SUPPORT
    Member
    Post count: 11032

    I’ll forward this to the developer for feedback.

    #51423
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi Aaron,

    Apologies for this – simple css fix:

    p.archive-description {
    	clear: both;
    	padding-top: 20px;
    }

    Let me know that it works for you.

    – Ed

    #55841
    airuck
    Member
    Post count: 36

    Hi Ed,

    I didn’t get a notification on this unfortunately, didn’t realize I had to subscribe. Sorry for the delay.

    I wish it were so simple! That rule is already in place, but doesn’t help. Here’s why.

    We’re actually not using the archive description to display content above, rather, we made a shop page to display richer content above the fold. But still, the idea behind this fix won’t work, because the content in question is /after/ div.woocommerce-count-wrap and form.woocommerce-ordering. This is the real problem.

    For example, on a category product archive page, I’m using html in the category description, which has the css rule you mention already in place, to no effect:

    .term-description, p.archive-description {
    	clear: both;
    	padding-top: 20px;
    }

    These elements are locked into the html template, and the woocommerce_archive_description action is called after these elements are outputted (line 186 in archive-product.php).
    The only CSS trickery that would work was forcing them below the existing element using position:absolute, since they’re actually earlier in the DOM, so no clearing is going to work, you have to take the elements out of the DOM flow and hack them in below the element in question.

    Even something as simple as moving line 186 up to line 145 (the do_action call) places page content ahead of the output of the ordering and result counts, and allows proper styling, since these elements really should always be attached to the product results themselves, and the archive_description is getting between these two things.

    This is a start, but it still means using CSS to hide the sorting, for example, rather than removing it via a remove_action on woocommerce_catalog_ordering. since those 2 actions are now hardcoded (woocommerce_result_count, and woocommerce_catalog_ordering, since there’s no more woocommerce_before_shop_loop call now)

    Still, it would save me (and anyone else trying to style these things and use archive and category page headers) a ton of trouble. I have probably 50 lines of css (across various responsive stylesheets) to account for the height of the header element (which changes as the page shrinks, so the top value on the result-count div has to change). It’s actually already broken on pagination (where the header disappears for some reaon). It would be a big relief if it could just fixed at the source.

    I think I subscribed properly this time, so I’ll answer more quickly, sorry about that!

    #56723
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please share website URL with worpdress admin login credential so i can check and fix your issues easily .

    Note -> Mark as private reply .

    Thanks 🙂
    With Best Regards
    Swift Ideas

    #57095
    airuck
    Member
    Post count: 36
    This reply has been marked as private.
    #57246
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @airuck – I see what you mean.

    What you want to do is edit /woocommerce/archive-product.php and move line 186:

    <?php do_action( 'woocommerce_archive_description' ); ?>

    to below line 144:

    <div class="page-content <?php echo $content_class; ?>">

    That should do it!

    – Ed

    #57424
    airuck
    Member
    Post count: 36

    hey Ed,

    Yeah, that’ll definitely do it, but I really wanted to keep template compatibility (which is why I ran through the css loopholes in the first place). Is this something that can be done with the next version, so I know I’ll be okay to change it now? It seems to be a non-breaking change, and I believe this is how the structure was before the woocommerce 2.1 support was added (though I haven’t checked the codebase, but just from how our shop pages were laid out a couple of months ago, this makes sense).
    Thanks for taking a look!

    #57442
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    If you add a /woocommerce folder to your child theme, and then add in that file, it will stick with updates. Will check it for a future update, and possibly change it around.

    Hope that helps.

    – Ed

    #57840
    airuck
    Member
    Post count: 36

    Yeah, I was hoping to avoid overriding the template, that’s the option I guess I’m left with though. if I get a few minutes I’ll submit a patch re-adding the hooks, maybe that can help. Understand you’re busy, thanks for taking the time to reply!

    #58147
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    No worries!

    – Ed

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.