• Resolved wpguillaume

    (@wpguillaume)


    Hello,

    I’ve customized the “Home” page of the linked site to use the Homepage template of the Storefront theme, in order to display a hero image overlaid with text.
    It would make a suitable shop page for me.

    If I set this “Home” page as the shop page in WooCommerce Product settings, it gets rid of my customization. From what I’ve grasped online, something along the lines of “because WooCommerce shop page is an archive page, it can’t be another template at the same time.”

    It also seems that it’s important to set a WooCommerce Shop page properly, as for instance it is linked by the “Return to Shop” button shown on an empty cart page.

    I’ve also read that a Redirect could be done from a WooCommerce Shop page to my “Home” page, but it feels hacky. Is it?

    Now, I’ve tried finding the code for the hero image display in Storefront, to “add” it to the woocommerce_before_main_content hook. I’ve located a homepage.js script file, and tried to “enqueue” it in my child theme’s function.php file, but I have no clue if’s doable and/or the right thing to to…

    Am I going in the right direction? ??

    To sum it up, basically I’d like the WooCommerce shop page to be my home page and, that it’d look like the current home page linked to this post. Having only a https:://domain.tld URL for the Shop page would be nice, instead of https://domain.tld/shop

    Thank you very much!

    (Sorry if this post is unclear, it’s not very clear in my mind either!)

    System status report:

    
    ### WordPress Environment ###
    
    WordPress address (URL): see link
    Site address (URL): see link
    WC Version: 3.9.2
    REST API Version: ? 1.0.7
    Log Directory Writable: ?
    WP Version: 5.3.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: fr_FR
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.25 (Debian)
    PHP Version: 7.4.1
    PHP Post Max Size: 32 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 10000
    cURL Version: 7.52.1
    OpenSSL/1.0.2r
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.1.43-MariaDB-1~stretch
    Max Upload Size: 32 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 3.9.2
    WC Database Prefix: MyPfx_
    Taille totale de la base de données: 3.90MB
    Taille de la base de données: 2.58MB
    Taille de l’index: 1.32MB
    MyPfx_woocommerce_sessions: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_woocommerce_api_keys: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_woocommerce_attribute_taxonomies: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_woocommerce_downloadable_product_permissions: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
    MyPfx_woocommerce_order_items: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_woocommerce_order_itemmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_woocommerce_tax_rates: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
    MyPfx_woocommerce_tax_rate_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_woocommerce_shipping_zones: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_woocommerce_shipping_zone_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_woocommerce_shipping_zone_methods: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_woocommerce_payment_tokens: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_woocommerce_payment_tokenmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_woocommerce_log: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_aiowps_events: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_aiowps_failed_logins: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_aiowps_global_meta: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_aiowps_login_activity: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_aiowps_login_lockdown: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_aiowps_permanent_block: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    MyPfx_commentmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_comments: Données : 0.02MB + Index : 0.09MB + Moteur InnoDB
    MyPfx_links: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_options: Données : 1.42MB + Index : 0.13MB + Moteur InnoDB
    MyPfx_postmeta: Données : 0.16MB + Index : 0.17MB + Moteur InnoDB
    MyPfx_posts: Données : 0.27MB + Index : 0.14MB + Moteur InnoDB
    MyPfx_termmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_terms: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_term_relationships: Données : 0.05MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_term_taxonomy: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_usermeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_users: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
    MyPfx_wc_download_log: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    MyPfx_wc_product_meta_lookup: Données : 0.02MB + Index : 0.09MB + Moteur InnoDB
    MyPfx_wc_tax_rate_classes: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_wc_webhooks: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_yoast_seo_links: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    MyPfx_yoast_seo_meta: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    ### Post Type Counts ###
    
    attachment: 376
    customize_changeset: 15
    nav_menu_item: 6
    page: 9
    post: 1
    product: 78
    revision: 21
    scheduled-action: 23
    wpforms: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (10) ###
    
    All In One WP Security: par Tips and Tricks HQ
    Peter Petreski
    Ruhul
    Ivy – 4.4.3
    
    File Renaming on upload: par Pablo S G Pacheco – 2.3.8
    Homepage Control: par WooThemes – 2.0.3
    Imsanity: par Exactly WWW – 2.5.0
    Image de menu: par Rui Guerreiro – 2.9.5
    Hide SEO Bloat: par SO WP – 3.13.4
    WooCommerce: par Automattic – 3.9.2
    Yoast SEO: par L’équipe Yoast – 13.0
    WP Mail SMTP: par WPForms – 1.8.1
    WPForms Lite: par WPForms – 1.5.8.2
    
    ### Inactive Plugins (2) ###
    
    Product CSV Import Export (BASIC): par WebToffee – 1.7.2 – Non testé avec la version active de WooCommerce
    Simple Basic Contact Form: par WPKube – 20200219
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    Currency Position: right
    Thousand Separator: 
    Decimal Separator: ,
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Base de la boutique: #56 - /
    Panier: #7 - /panier/
    Validation de la commande: #8 - /commande/
    Mon compte: ? La visibilité de la page doit être publique
    Conditions générales de vente et d’utilisation: ? Page non définie
    
    ### Theme ###
    
    Name: Storefront Child
    Version: 1.0.0
    Author URL: 
    Child Theme: ?
    Parent Theme Name: Storefront
    Parent Theme Version: 2.5.4
    Parent Theme Author URL: https://woocommerce.com/
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: –
    
    ### Action Scheduler ###
    
    Terminer: 23
    Oldest: 2020-01-24 23:28:07 +0100
    Newest: 2020-02-05 20:54:05 +0100
    
    En attente: 0
    Oldest: –
    Newest: –
    
    Annulé: 0
    Oldest: –
    Newest: –
    
    En cours: 0
    Oldest: –
    Newest: –
    
    échoué: 0
    Oldest: –
    Newest: –
    
    

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I concur with everything that you have found.

    The Shop page is an archive page that serves multiple purposes in woocommerce.

    Redirecting your /shop URL back to the homepage does feel like a kludge. But it will get the job done because the other uses of the archive template will have different URLs.

    Your other option is to setup a child theme and copy archive.php into your child theme as archive-product.php. Then customize the archive-product.php template as needed.

    If you do child theme template override, your hero section customization will be present on the other uses of the product archive page which is something you may not want (and why the standard homepage with /shop redirect is a fine solution).

    Thread Starter wpguillaume

    (@wpguillaume)

    I thing I’m gonna go for the easy way: .htaccess 301 redirection. ??

    – because I’d struggle to find the right code to insert into archive-product.php
    – because if I want to change my home page customization, it would have to be through this code instead of doing it naturally in the WordPress editor
    – because I won’t have to check that WooCommerce updates to archive-product.php make it to my child theme override.

    Would this be enough, or does the redirect need to take care of any /shop/<xyz> URLS as well?
    Redirect 301 /shop/ https://domain.tld/

    Thank you for the enlightenments!

    • This reply was modified 4 years, 9 months ago by wpguillaume. Reason: redirect question
    • This reply was modified 4 years, 9 months ago by wpguillaume.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizing the shop page (or getting rid of it?)’ is closed to new replies.