• Resolved GWMO

    (@gwmo)


    I’m trying to improve “Related Products” to help 50+ Authors cross-promote so any advice would be greatly appreciated.

    I’m having trouble isolating the “Related Products” controls/code. All I get from Chrome Inspector is the class “Related Products” and could not find any other references to it in the forums.

    The site does use WooCommerce but there are no linked products and no WooCommerce plugins appear to be installed for related products. Jetpack is installed but “Related Posts” is turned off.


    ### WordPress Environment ###

    Home URL: https://www.darkmoonpress.com
    Site URL: https://www.darkmoonpress.com
    WC Version: 3.4.0
    Log Directory Writable: ?
    WP Version: 4.9.6
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –

    ### Server Environment ###

    Server Info: LiteSpeed
    PHP Version: ? 5.6.36 – We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version
    PHP Post Max Size: 64 MB
    PHP Time Limit: 0
    PHP Max Input Vars: 6000
    cURL Version: 7.54.0
    OpenSSL/1.0.2k

    SUHOSIN Installed: –
    MySQL Version: 10.0.35
    Max Upload Size: 64 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?

    ### Database ###

    WC Database Version: 3.3.5
    WC Database Prefix: p4Po0G175_
    MaxMind GeoIP Database: ?
    Total Database Size: 44.40MB
    Database Data Size: 34.73MB
    Database Index Size: 9.67MB
    p4Po0G175_woocommerce_sessions: Data: 8.36MB + Index: 0.27MB
    p4Po0G175_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.01MB
    p4Po0G175_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_order_items: Data: 0.02MB + Index: 0.01MB
    p4Po0G175_woocommerce_order_itemmeta: Data: 0.11MB + Index: 0.09MB
    p4Po0G175_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.01MB
    p4Po0G175_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_woocommerce_log: Data: 0.02MB + Index: 0.02MB
    p4Po0G175_aiowps_events: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_aiowps_failed_logins: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_aiowps_global_meta: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_aiowps_login_activity: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_aiowps_login_lockdown: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_aws_index: Data: 2.52MB + Index: 0.00MB
    p4Po0G175_commentmeta: Data: 0.02MB + Index: 0.05MB
    p4Po0G175_comments: Data: 0.13MB + Index: 0.09MB
    p4Po0G175_icwp_wpsf_ip_lists: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_icwp_wpsf_user_management: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_links: Data: 0.02MB + Index: 0.02MB
    p4Po0G175_options: Data: 5.39MB + Index: 0.28MB
    p4Po0G175_pmxe_exports: Data: 0.08MB + Index: 0.00MB
    p4Po0G175_pmxe_google_cats: Data: 0.26MB + Index: 0.05MB
    p4Po0G175_pmxe_posts: Data: 0.02MB + Index: 0.01MB
    p4Po0G175_pmxe_templates: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_postmeta: Data: 8.52MB + Index: 5.03MB
    p4Po0G175_posts: Data: 1.52MB + Index: 0.31MB
    p4Po0G175_relevanssi: Data: 0.75MB + Index: 1.20MB
    p4Po0G175_relevanssi_log: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_relevanssi_stopwords: Data: 0.01MB + Index: 0.01MB
    p4Po0G175_sm_advanced_search_temp: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_cats: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_event_log: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_sp_cu_forms: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_form_entries: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_groups: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_groups_assign: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_sp_cu_project: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_termmeta: Data: 0.02MB + Index: 0.02MB
    p4Po0G175_terms: Data: 0.06MB + Index: 0.03MB
    p4Po0G175_term_relationships: Data: 0.14MB + Index: 0.09MB
    p4Po0G175_term_taxonomy: Data: 0.06MB + Index: 0.06MB
    p4Po0G175_usermeta: Data: 0.16MB + Index: 0.14MB
    p4Po0G175_users: Data: 0.02MB + Index: 0.05MB
    p4Po0G175_wc_download_log: Data: 0.02MB + Index: 0.03MB
    p4Po0G175_wc_webhooks: Data: 0.02MB + Index: 0.02MB
    p4Po0G175_wfBadLeechers: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfBlockedCommentLog: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_wfBlockedIPLog: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfBlocks: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfBlocks7: Data: 0.02MB + Index: 0.05MB
    p4Po0G175_wfBlocksAdv: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfConfig: Data: 0.26MB + Index: 0.02MB
    p4Po0G175_wfCrawlers: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfFileChanges: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_wfFileMods: Data: 1.79MB + Index: 0.39MB
    p4Po0G175_wfHits: Data: 0.43MB + Index: 0.10MB
    p4Po0G175_wfHoover: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfIssues: Data: 0.01MB + Index: 0.01MB
    p4Po0G175_wfKnownFileList: Data: 1.52MB + Index: 0.00MB
    p4Po0G175_wfLeechers: Data: 0.12MB + Index: 0.18MB
    p4Po0G175_wfLockedOut: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfLocs: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfLogins: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfNet404s: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfNotifications: Data: 0.02MB + Index: 0.00MB
    p4Po0G175_wfPendingIssues: Data: 0.02MB + Index: 0.13MB
    p4Po0G175_wfReverseCache: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfScanners: Data: 0.01MB + Index: 0.02MB
    p4Po0G175_wfSNIPCache: Data: 0.02MB + Index: 0.05MB
    p4Po0G175_wfStatus: Data: 0.06MB + Index: 0.03MB
    p4Po0G175_wfThrottleLog: Data: 0.00MB + Index: 0.00MB
    p4Po0G175_wfVulnScanners: Data: 0.00MB + Index: 0.00MB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB
    wp_comments: Data: 0.02MB + Index: 0.08MB
    wp_links: Data: 0.02MB + Index: 0.02MB
    wp_options: Data: 1.52MB + Index: 0.02MB
    wp_postmeta: Data: 0.02MB + Index: 0.03MB
    wp_posts: Data: 0.02MB + Index: 0.06MB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB
    wp_terms: Data: 0.02MB + Index: 0.03MB
    wp_term_relationships: Data: 0.02MB + Index: 0.02MB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB
    wp_usermeta: Data: 0.02MB + Index: 0.03MB
    wp_users: Data: 0.02MB + Index: 0.05MB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB

    ### Post Type Counts ###

    attachment: 371
    custom_css: 1
    guest-author: 1
    jp_img_sitemap: 2
    jp_sitemap: 2
    jp_sitemap_master: 2
    mc4wp-form: 1
    molongui_guestauthor: 1
    mt_pp: 7
    nav_menu_item: 55
    page: 21
    post: 14
    product: 249
    product_variation: 12
    revision: 62
    shop_coupon: 1
    shop_order: 163
    slides: 1
    writer: 57
    writers: 10

    ### Security ###

    Secure connection (HTTPS): ?
    Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ?

    ### Active Plugins (38) ###

    ManageWP – Worker: by ManageWP – 4.5.0
    Adminimize: by Frank Bültge – 1.11.4
    Advanced Woo Search: by ILLID – 1.41 – Not tested with the active version of WooCommerce
    Akismet Anti-Spam: by Automattic – 4.0.3
    Better Click To Tweet: by Ben Meredith – 5.4.3
    Email Address Encoder: by Till Krüss – 1.0.7
    Simple Calendar: by Simple Calendar – 3.1.15
    Jetpack by WordPress.com: by Automattic – 6.1.1
    MailChimp for WordPress: by ibericode – 4.2.2
    User Profile Picture: by Ronald Huereca – 1.4.3
    PDF Catalog: by ovologics – 1.1.18 – Not tested with the active version of WooCommerce
    Product CSV Import Export (BASIC): by XAdapter – 1.4.4 – Not tested with the active version of WooCommerce
    Recent Posts Widget With Thumbnails: by Martin Stehle – 6.2
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.0.2
    Relevanssi: by Mikko Saari – 4.0.9
    Reveal IDs: by Oliver Schl?be – 1.5.2
    Search Everything: by Sovrn
    zemanta – 8.1.9

    Search Exclude: by Roman Pronskiy – 1.2.2
    Smart Manager: by StoreApps – 3.18.0
    Theme My Login: by Jeff Farthing – 6.4.12
    WordPress Users & WooCommerce Customers Import Export(BASIC): by XAdapter – 1.1.1 – Not tested with the active version of WooCommerce
    USPS WooCommerce Shipping: by Xadapter – 4.0.1 – Not tested with the active version of WooCommerce
    W3 Total Cache: by Frederick Townes – 0.9.7
    WooCommerce Product Subtitle: by Varun Sridharan – 3.1
    White Label CMS: by https://www.videousermanuals.com – 1.6.4
    Widget Logic: by wpchefgadget
    alanft – 5.8.2

    WooCommerce Wholesale Pricing: by wpexpertsio – 1.4 – Not tested with the active version of WooCommerce
    WooCommerce Extended Coupon Features: by Soft79 – 2.6.2 – Not tested with the active version of WooCommerce
    Woocommerce Bulk Attribute Manager: by Varun Sridharan – 2.2.1 – Not tested with the active version of WooCommerce
    WooCommerce Google Analytics Integration: by WooCommerce – 1.4.4 – Not tested with the active version of WooCommerce
    WooCommerce Product SKU Generator: by SkyVerge – 2.3.3 – Not tested with the active version of WooCommerce
    WooCommerce: by Automattic – 3.4.0
    WordPress Importer: by wordpressdotorg – 0.6.4
    WP All Export: by Soflyy – 1.2.0
    WP-Optimize: by David Anderson
    Ruhani Rabin
    Team Updraft – 2.2.4

    WP PHP widget: by wpxue – 1.0.2
    WP Subtitle: by Ben Huson
    Husani Oakley – 3.0

    Custom Product Tabs for WooCommerce: by YIKES
    Inc. – 1.6.4 – Not tested with the active version of WooCommerce

    ### Settings ###

    API Enabled: ?
    Force SSL: –
    Currency: USD ($)
    Currency Position: left
    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)

    ### WC Pages ###

    Shop base: #6 – /browse/
    Cart: #7 – /cart/
    Checkout: #8 – /checkout/
    My account: #9 – /my-account/
    Terms and conditions: ? Page not set

    ### Theme ###

    Name: Dark Moon
    Version: 1.1.1
    Author URL: https://jvkrakowski.com
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ?

    ### Templates ###

    Archive Template: Your theme has a woocommerce.php file
    you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.

    Overrides: –
    `

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    By default, cross-sells and up-sells can be configured on a per product page in the WordPress admin area under Products > All Products > YOUR PRODUCT > Product Data > Linked Products:


    Link to image: https://cld.wthms.co/fA5EUV

    In the event that those aren’t configured, WooCommerce uses the category and tags associated with that products to find other products to link to.

    If you want to take a closer look at the code powering that, check out the following link: https://github.com/woocommerce/woocommerce/blob/786641e9761bcd8713cb752bcf87f77f2f6e5965/includes/wc-template-functions.php#L1909-L1945

    Thread Starter GWMO

    (@gwmo)

    Thank you RK. I’m familiar with linked products and find it very useful.

    Since I’m dealing with 250+ books and an ever changing inventory, I need to focus more on the category/tag options and the code you provided is very helpful.

    Would it be possible to add ELSE/IF logic to the category/tag, or even attributes, portion of the code or is there a plugin that already does this; perhaps allowing the user to add custom ELSE/IF statements? For example:

    IF

    another book in the same SERIES

    EELSE IF

    another book in the same GENRE

    ELSE IF

    another book by the same AUTHOR

    ELSE

    books with the “New Release” category/tag/attribute

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there,

    That would certainly be possible but take some custom work to make happen. You’d want to hook into the appropriate spot (from what RK linked you to) and remove an action and replace all that code with your own logic and function.

    Like I said, it’s possible but takes a little custom work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem Isolating Related Products to Configure Code’ is closed to new replies.