Home Blog Page 4

Reviews Management in OpenCart 4

Product reviews play a vital role in building trust, improving product credibility, and enhancing customer engagement on eCommerce platforms. OpenCart 4 provides a powerful Reviews Management system, enabling store owners to manage customer feedback efficiently. This opencart user manual will guide you through the features, benefits, and steps for managing reviews in OpenCart.

Why Product Reviews Matter

  • Build Trust: Positive reviews increase customer confidence.
  • SEO Benefits: Reviews generate unique user-generated content, enhancing search engine visibility.
  • Customer Insights: Feedback helps you understand what customers love or where improvements are needed.

Accessing Reviews Management in OpenCart

To manage reviews in OpenCart:

  1. Log in to the OpenCart admin panel.
  2. Navigate to Catalog > Reviews from the menu.
Opencart reviews

Adding a New Review

Although most reviews are submitted by customers on the storefront, administrators can manually add reviews if needed. Here’s how:

  1. Click the Add New button in the Reviews section.
  2. Fill in the required fields:
    • Author: Enter the name of the reviewer.
    • Product: Select the product the review pertains to.
    • Text: Write or paste the review content.
    • Rating: Assign a rating between 1 (lowest) and 5 (highest).
    • Status: Set the review status to “Enabled” to make it visible on the storefront.
  3. Click Save to add the review.
Opencart Add reviews

Editing a Review

If a customer submits a review that requires modifications (e.g., grammar correction or inappropriate content), follow these steps:

  1. Locate the review in the Reviews list.
  2. Click the Edit button next to the review.
  3. Make the necessary changes.
  4. Click Save to update the review.

Deleting a Review

To remove reviews that are irrelevant, spammy, or inappropriate:

  1. Select the checkbox next to the review(s) you wish to delete.
  2. Click the Delete button.
  3. Confirm the action to permanently delete the selected review(s).

Enabling and Disabling Reviews

Reviews can be temporarily hidden by disabling them:

  1. Edit the review and set the Status to “Disabled.”
  2. Save the changes.

Best Practices for Reviews Management

  • Moderate Reviews Regularly: Regularly review and approve customer feedback to maintain quality.
  • Encourage Reviews: Use follow-up emails to request reviews from customers after purchase.
  • Respond to Feedback: Address negative reviews constructively to demonstrate excellent customer service.

Troubleshooting Reviews Issues

  • Reviews Not Showing: Ensure the review status is “Enabled” and the product linked to the review is active.
  • Spam Reviews: Use CAPTCHA or manual moderation to prevent spam submissions.

Conclusion

The Reviews Management system in OpenCart 4 empowers store owners to leverage customer feedback for building trust and driving sales. By efficiently moderating, responding to, and encouraging reviews, you can create a dynamic and trustworthy shopping experience for your customers.

Manufacturer or Brand Management in OpenCart 4 – user manual

Manufacturer management or Brand management in OpenCart 4 allows you to organize and display products by brand or manufacturer. This feature is especially useful for users who prefer to shop by brand and for showcasing brand-specific product offerings.

Adding a New Manufacturer

Opencart manufacturers
  1. Log in to your OpenCart admin panel.
  2. Navigate to Catalog > Manufacturers from the admin menu.
  3. Click the Add New button in the Manufacturer Management section.
  4. Fill in the following details:
    • Manufacturer Name: Enter the name of the manufacturer.
    • Stores: Select stores where you want this manufacturer to show
    • Image: Upload a logo or image to represent the manufacturer. Click the image field and choose or upload an image from the media manager.
    • Sort Order: Set the order in which the manufacturer will appear in lists. Leave blank to use default sorting.
  5. SEO URL: Provide a unique SEO-friendly URL for the manufacturer. This improves search engine visibility.
  6. Design: You can have different layout as per manufacturer. Flexible design layout system for customizing the appearance and functionality of the Product. Learn more about Design layout override.
  7. Click Save to add the new manufacturer to the system.
Opencart manufacturers or brands

    Editing an Existing Manufacturer

    1. In the Manufacturer Management list, locate the manufacturer you wish to edit.
    2. Click the Edit button next to the manufacturer name.
    3. Update the desired fields.
    4. Click Save to apply the changes.

    Deleting a Manufacturer

    1. Select the checkbox next to the manufacturer(s) you wish to delete.
    2. Click the Delete button at the top right.
    3. Confirm the deletion when prompted.

      Note that deleting a manufacturer does not delete the associated products but removes the manufacturer link.

    Assigning Manufacturers to Products

    1. Navigate to Catalog > Products.
    2. Edit the product you want to associate with a manufacturer.
    3. Under the Links tab, select the manufacturer from the dropdown list.
    4. Save the product.
    Links Products

    By properly managing manufacturers in OpenCart, you can enhance user experience, improve product organization, and boost your store’s SEO rankings. We hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Webocreation Twitter and Webocreation Facebook. Please let us know if you have any questions or concerns.

    Attributes management in Opencart 4 – user manual

    Attributes in OpenCart 4 enable you to provide detailed product information and help customers make informed purchasing decisions. This Opencart user manual will guide you through the process of managing attributes in OpenCart 4.

    What are Attributes?

    Attributes provide additional information or specifications about a product. They are more descriptive and non-interactive. These details help customers refine their search and compare products effectively.

    Key Differences between Options and Attributes

    FeatureOptionsAttributes
    PurposeInteractive selection by customersDescriptive product details
    Customer InteractionYesNo
    DisplayedOn product page, selectableIn product details, non-selectable
    Affects PricingYes, can adjust priceNo
    Stock TrackingLimited (requires extensions)No
    ExamplesSize, Color, Add-onsMaterial, Features, Weight, Dimensions

    Accessing Attribute Management

    1. Log in to your OpenCart admin panel.
    2. Navigate to Catalog > Attributes.
    3. You will see two submenus:
      • Attributes: Manage individual attributes.
      • Attribute Groups: Organize attributes into groups for better usability.

    Creating an Attribute Group

    Attribute groups product
    1. Navigate to Catalog > Attributes > Attribute Groups.
    2. Click the Add New button.
    3. Fill in the required fields:
      • Attribute Group Name: Enter a name for the group (e.g., “Processor”).
      • Sort Order: Define the display order.
    4. Click Save.
    Attribute group add

    Creating a New Attribute

    Product attributes
    1. Go to Catalog > Attributes > Attributes.
    2. Click the Add New button.
    3. Fill in the required fields:
      • Attribute Name: Enter the name of the attribute (e.g., “Clockspeed”).
      • Attribute Group: Select the group this attribute belongs to (optional).
      • Sort Order: Enter a number to define the display order of this attribute.
    4. Click Save.
    Attributes add product

    Editing an Attribute

    1. Go to Catalog > Attributes > Attributes.
    2. Locate the attribute you want to edit using the search or filter options.
    3. Click the Edit button next to the attribute.
    4. Make the necessary changes and click Save.

    Deleting an Attribute

    1. Go to Catalog > Attributes > Attributes.
    2. Select the checkbox next to the attribute(s) you want to delete.
    3. Click the Delete button.
    4. Confirm the deletion.

    Note: Deleting an attribute will remove it from all products where it is used.

    Assigning Attributes to Products

    1. Go to Catalog > Products and edit the desired product.
    2. Navigate to the Attributes tab.
    3. Click Add Attribute.
    4. Select an attribute from the dropdown list.
    5. Enter the corresponding value for the attribute (e.g., “100mhz” for “Clockspeed”).
    6. Repeat for additional attributes as needed.
    7. Click Save.
      Assign attributes to product
    8. In the frontend, it shows in Description section at Specification tab
    Specification tab in Product

    Best Practices for Attribute Management

    1. Organize Attributes Using Groups:
      • Group related attributes (e.g., “Display” group for screen size and resolution).
    2. Use Descriptive Names:
      • Clearly define attribute names to avoid confusion.
    3. Consistent Values:
      • Use consistent formatting for attribute values (e.g., “5.5 inches” instead of “5.5”).
    4. Update Regularly:
      • Periodically review and update attributes to reflect product changes.
    5. Test on Frontend:
      • Verify that attributes display correctly on the product page.

    Troubleshooting

    Attribute Not Showing on the Product Page

    • Ensure the attribute is assigned to the product.
    • Verify the attribute group is properly configured.
    • Clear the cache from Dashboard > Developer Settings.

    Duplicate Attributes

    • Use the search functionality to check for duplicates before creating new attributes.
    • Regularly review your attribute list.

    Conclusion

    Proper attribute management enhances the customer experience and improves search functionality on your e-commerce website. OpenCart 4 provides a robust system to organize and display product attributes effectively. Follow this manual to streamline attribute management and ensure accurate product representation.

    Products management in OpenCart 4 with Best Practices

    Managing products effectively is one of the key aspects of running a successful e-commerce store. OpenCart 4 makes it easy to add, edit, and delete products through its intuitive admin panel. This opencart user manual walks you through the process and shares some best practices for product management and SEO optimization.

    Adding a Product

    Follow these steps to add a new product in OpenCart:

    • Login to Admin Panel: Navigate to your OpenCart admin dashboard.
    • Go to Products: Click on Catalog > Products.
      Opencart product listing page
    • Add New Product: Click the Add New blue button (➕).
    • Fill in Product Details:

      General Tab:

      Product Name: Enter the name of the product.
      Description: Provide a detailed description using keywords to improve SEO.
      Meta Tag Title: Title of the page, mostly useful for SEO Title. Create an engaging title using the primary keyword.
      Meta Tag Description: Write a concise, compelling summary of the product, including keywords.
      Meta Tag keywords: It used to be useful for SEO but for nowadays not very beneficial but does not hurt if entered useful keyword.
      Product General Tab
    • Data Tab:
      It is separated to Model, Price, Stock and Specification section
      Model: Enter the product model which is required field. Other fields like SKU (Stock Keeping Unit), UPC (Universal Product Code), EAN (European Article Number), JAN (Japanese Article Number), ISBN (International Standard Book Number), MPN (Manufacturer Part Number) and location
      Model Products
      Price: Set the main price of the product.
      Tax Class: Select the tax class for the product. Read more about how to set the different tax class
      Quantity: Quantity of products available
      Minimum Quantity: Force a minimum ordered quantity. If you set 2, then at least 2 same products need to be ordered.
      Subtract Stock: When this is enabled, the quantity will decrease once someone order the product.
      Out of Stock Status: When the quantity of products become zero then this stock status is shown. Learn how to set the Out of Stock Status
      Date Available: Make sure this date available is before now time, else the product will not show in frontend. You can set this Date Available to future date if you want it to be available on future date.


      Price Stock Products
      Specification section
      Requires Shipping: If you are selling physical products and needed it to be shipped then this needs to be enabled. If you are selling digital products like PDF where no shipping is required then you can disable it.
      Dimensions: Enter length, width and height of product. This information are used by Shipping method for calculating the shipping prices.
      Length Class: As different countries different measurement units, so you can select which length class you will set for this product. Read more how to set Length Class.
      Weight: Enter the weight of the product.
      Weight Class: Select the weight class. Read more how to set weight class.
      Status: Status is to show in the frontend or not.
      Sort Order: This is useful when you want to sort the products. Mostly useful for searching products, category listing etc.

      Product Specification
    • Links Tab:
      Manufacturer: Select or add the manufacturer. As Manufacturer field is autocomplete select type, so start typing the manufacturer name and it will list out and then select it.
      Categories: Start typing the category name and select it. You can select multiple categories for a product. Category Management
      Filters: Add filters to the products which helps on filtering at category page or other product listing page where filter is enabled. Filter management.

      Links Products
      Stores: Assign products to one or more stores. Mostly there will be default store available if you have not set multi-store. Multistore setup.
      Downloads: If you are selling digital products like PDF, docs, zip, images etc then you can add the download here. Downloads management.
      Related Products: Link other relevant products to cross-sell.
      Products links
    • Attribute Tab:
      Click the add button on the Attribute tab and enter the attribute and its description
      Attribute tab product
      The same entered attributes shows in the frontend product detail page at specification tab.
      Specification tab in Product
    • Option Tab:
      In the Option tab, enter the available option for the product.
      Product Option
    • Subscription Tab:
      If your product offer subscription payment then you can enter the details here.
      Product Subscription
    • Discount Tab: A discount is a price reduction applied to a product based on certain conditions, such as the quantity purchased.
      Product discount
    • Special Tab: A special is a temporary promotional price for a product, regardless of the quantity purchased. Add promotional pricing if applicable.
      Product Special pricing
    • Images: The top image is the main image of the product. Additional images are show below the main image in the frontend of default theme.
      Product Images
    • Reward Points: If your store support reward points, then you can manage reward points for the product in the Reward Points tab. Here in the screenshot, 400 is number of points needed to buy this product. 100 is the reward points earned when someone ordered this product.
      Products reward points
    • SEO: The keyword entered here will be shown in the URL. Use short, descriptive URLs that include keywords. Do not use spaces, instead replace spaces with – and make sure the SEO URL is globally unique. Example: /apple-cinema
      Product SEO
    • Design Tab: You can have different layout as per product. Flexible design layout system for customizing the appearance and functionality of the Product. Learn more about Design layout override.
      Product Design
    • Report: You can see some list of IPs, store, country and date added.
      Product Report
    • Save the Product: Click Save to add the product to your catalog.

      Editing a Product

      1. Locate the Product:
        • Navigate to Catalog > Products.
        • Use the search bar to find the product you want to edit.
      2. Edit Details:
        • Click the Edit button (✏️) next to the product.
        • Update the necessary fields (e.g., price, stock, images, description).
      3. Save Changes: After making the updates, click Save.

      Deleting a Product

      1. Select the Product:
        • Go to Catalog > Products.
        • Check the box next to the product(s) you wish to delete.
      2. Delete the Product:
        • Click the Delete button (🗑️).
        • Then, click to confirm the deletion when prompted.

      Note: Deleting a product is permanent. Make sure to back up your database regularly.

      SEO Best Practices

      1. Product Titles

      • Make product titles descriptive and keyword-rich.
      • Example: Instead of “Shaving Cream,” use “Natural Aloe Vera Shaving Cream for Sensitive Skin.”

      2. Meta Tags

      • Meta Title: Create an engaging title using the primary keyword (e.g., “Buy Natural Shaving Cream | Gentle on Skin”).
      • Meta Description: Write a concise, compelling summary of the product, including keywords.

      3. SEO-Friendly URLs

      • Use short, descriptive URLs that include keywords.
      • Example: /natural-aloe-vera-shaving-cream

      4. Product Descriptions

      • Include long-tail keywords naturally.
      • Use bullet points to highlight features and benefits.
      • Avoid duplicate content to prevent SEO penalties.

      5. Categories and Tags

      • Place products in relevant categories.
      • Add tags that reflect popular search terms related to the product.

      Best Practices for Managing Products

      1. Keep Product Data Up-to-Date:
        • Regularly review and update stock levels, descriptions, and prices.
      2. Optimize for Mobile:
        • Ensure images and descriptions display well on mobile devices.
      3. Monitor Analytics:
        • Use OpenCart’s reporting tools or integrate Google Analytics to track product performance.
      4. Offer Variations:
        • Use product options for size, color, or other variations.
      5. Leverage Reviews:
        • Encourage customers to leave reviews to build trust and improve SEO.

      Where to look if the product is not showing in the frontend?

      If a product is not showing on the frontend of an OpenCart store, several factors could be causing the issue. Here’s a checklist to systematically diagnose and resolve the problem:

      • Date available is set for future date
      • Status is not enabled
      • Stores assignment is not checked for default or to specific store where needed
      • Cache issue, clear the cache

      By following these steps and best practices, you can efficiently manage your OpenCart product catalog while optimizing for search engines, ensuring that your e-commerce store remains competitive and user-friendly.

      Anti-Fraud IP in Opencart 4, block IP that are fraudulent

      E-commerce platforms must prioritize security to maintain trust and protect transactions. OpenCart 4 comes equipped with features to combat fraudulent activities, one of which is the Anti-Fraud IP functionality. This feature allows store administrators to block specific IP addresses suspected of fraudulent behavior, safeguarding the integrity of the store and its customers.

      Key Features of Anti-Fraud IP

      1. Custom IP Blocking: Administrators can manually add IP addresses to the blocked list.
      2. Real-Time Monitoring: Detect and flag suspicious activities originating from certain IP addresses.
      3. Integration with Other Anti-Fraud Modules: OpenCart’s Anti-Fraud system integrates seamlessly with extensions that provide additional fraud detection capabilities.
      4. Logs and Reports: View logs of blocked IPs to analyze patterns and improve fraud detection strategies.

      Read more: Opencart Security

      How to Use Anti-Fraud IP

      1. Accessing the Anti-Fraud IP Settings

      • Log in to the OpenCart admin dashboard.
      • Navigate to Extensions > Extensions.
      • Select Anti-Fraud from the dropdown menu.
      • Locate and enable the Anti-Fraud IP extension.
      Anti Fraud Extension Opencart

      2. Adding an IP Address to the Blocked List

      • Go to Extensions > Extensions > Anti-Fraud > Anti-Fraud IP.
      • If not installed, install it then click edit it.
      • Paste the IP in IP input box and Click the Add IP button.
      • Save the changes.
      • The blocked IPs will be listed under the Anti-Fraud IP section.
      Block IP in Opencart

      Identify fraudulent IPs

      One way to identify fraudulent IP is by analyzing the Recent Activities in the Dashboard activities

      Recent Activity Customer

      We saw the First name and Last name looks suspicious and we click to get the details. Those name looks suspicious and we clicked the IP addresses tab.

      Suspicious name fraud

      We saw two IPs and one IP created multiple accounts:

      Customer IP lists

      When we click the 3 in the Total Accounts column, then we got a list of customers with weird name so those are suspicious registration so we blocked that IP.

      Suspicious customer IP

      Other ways to identify fraudulent IPs effectively are by following steps below:

      1. Monitor Website Traffic Logs:
        • Use tools like Google Analytics, server logs, or third-party monitoring tools to review unusual patterns, such as spikes in requests or repeated access attempts.
      2. Look for Repeated Failed Login Attempts:
        • Multiple login failures from the same IP might indicate brute-force attempts.
      3. Analyze Suspicious Order Patterns:
        • Orders with mismatched billing and shipping addresses or unusually large volumes from a single IP.
      4. Check for Scraping Activity:
        • Bots scraping product data may send multiple rapid requests, which can be traced to specific IPs.
      5. Use Anti-Fraud Tools:
        • Platforms like FraudLabs Pro or MaxMind can help detect fraudulent IPs by analyzing behavioral patterns.
      6. Engage Real-Time Blacklists (RBL):
        • Use databases like Spamhaus or Project Honeypot to cross-check IPs against known malicious addresses.
      7. Monitor Failed Payment Attempts:
        • Repeated payment failures, especially if associated with multiple card details, can signal fraud.
      8. Enable Firewall Alerts:
        • Security solutions like Cloudflare or Sucuri can provide alerts for unusual IP activity.
      9. Customer Feedback:
        • If customers report unusual account activity or transactions, investigate the associated IPs.
      10. Geolocation Analysis:
        • Check if the IP location aligns with the user’s claimed location. Discrepancies might indicate proxy or VPN usage.

      Benefits of Blocking Fraudulent IPs

      1. Enhanced Security: Prevent unauthorized access and fraudulent transactions.
      2. Reduced Chargebacks: Mitigate the risk of financial loss due to fraudulent orders.
      3. Improved Customer Trust: Demonstrates a commitment to protecting customer data and transactions.
      4. Better Resource Management: Minimize server load caused by malicious traffic.

      Best Practices for Anti-Fraud IP Management

      1. Use Trusted Fraud Detection Services: Integrate third-party fraud detection tools for more comprehensive coverage.
      2. Regularly Monitor Activity Logs: Review logs to identify new threats and patterns.
      3. Whitelist Trusted IPs: Ensure essential partners or services are not accidentally blocked.
      4. Educate Your Team: Train staff to recognize signs of fraudulent behavior.

      Conclusion

      The Anti-Fraud IP feature in OpenCart 4 provides a robust line of defense against fraudulent activities. By actively monitoring and managing IP addresses, store administrators can enhance security, protect revenue, and foster customer trust. Coupled with other security measures, it is an essential tool for any e-commerce business aiming to stay ahead of fraudsters.

      Design layout override – use cases and examples in Opencart 4

      OpenCart 4 provides a robust and flexible design layout system for customizing the appearance and functionality of your online store. One of the standout features is the ability to override design layouts without modifying core files. This functionality ensures that you can implement customizations in a way that’s easy to manage and update. Let’s explore what design layout overrides are, their use cases, and how to implement them effectively.

      What Are Design Layout Overrides?

      In OpenCart, layouts define how different pages of your store are structured. A layout specifies which modules appear in various positions (e.g., header, footer, sidebar) on a page. Design layout overrides allow you to customize these layouts for specific pages, categories, or products without altering the default settings or core files. This makes your store highly customizable while maintaining compatibility with future updates. This helps on:

      • Implementing unique promotional layouts
      • Maintaining upgradability
      • Creating custom pages
      • Modifying existing layouts for specific categories or products

      Why Use Design Layout Overrides?

      1. Custom Page Designs

      • You can create unique designs for individual pages, such as a custom homepage, promotional landing pages, or special campaign pages.
      • For example, you might want a “Black Friday Sale” page with its own layout and modules like countdown timers and banners.

      2. Category-Specific Layouts

      • Different categories may require unique layouts based on the type of products they contain.
      • For example, the “Electronics” category might feature a slideshow of gadgets, while the “Clothing” category displays a carousel of featured apparel.

      3. Product-Specific Layouts

      • Highlight premium or featured products with dedicated layouts.
      • For instance, a flagship product might have an expanded description, video module, and additional call-to-action buttons.

      4. SEO and User Experience Enhancements

      • Tailored layouts can improve user experience (UX) by presenting content in a way that’s optimized for specific audiences.
      • This also enhances SEO by ensuring relevant and structured content is displayed for search engines.

      How to Implement Design Layout Overrides in OpenCart 4

      Follow these steps to apply design layout overrides in OpenCart 4:

      Step 1: Access Layouts in Admin Panel

      1. Log in to your OpenCart admin panel.
      2. Navigate to Design > Layouts.
      3. You will see a list of predefined layouts (e.g., Home, Product, Category).

      Step 2: Create or Edit a Layout

      1. Click the Add New button to create a new layout or edit an existing one.
      2. Provide a meaningful name for your layout (e.g., “Black Friday Sale”).
      3. Assign the desired route (e.g., black-friday-sale). Routes define where the layout will be applied.
      Opencart Design Layout

      Step 3: Add Modules to Layout Positions

      1. In the layout editor, assign modules (e.g., Banners, Carousels, Latest Products) to specific positions (e.g., Content Top, Content Bottom, Column Left and Column Right).
      2. Configure each module as needed. For example, set banner images or define product categories.

      Step 4: Save and Test

      1. Save your changes and navigate to the assigned route in your store.
      2. Verify that the layout displays as expected. Tweak module settings or positions if necessary.

      Step 5: Assign Layout to the Category

      1. Edit the category where you want to assign the new layout. Here for an example, we will edit the Camera category and assign the Black Friday Sale layout to override the default category layout.
        Category Design Layout override in Category
      2. Then in the frontend the layout is different for the Camera category.
      Opencart Design layout frontend

      Examples of Layout Overrides

      1. Promotional Landing Page

      • Use Case: A dedicated page for a holiday sale.
      • Implementation:
        • Create a new layout.
        • Assign modules like a countdown timer, featured products, and promotional banners.
        • Route: promo/holiday-sale.

      2. Category-Specific Layout

      • Use Case: Enhancing the layout of the “Books” category.
      • Implementation:
        • Edit the “Category” layout or create a new one.
        • Assign a carousel module to display bestsellers in “Books.”
        • Route: category/books.

      3. Product-Specific Layout

      • Use Case: Highlighting a flagship smartphone.
      • Implementation:
        • Create a new layout.
        • Add modules such as a video gallery and a technical specifications block.
        • Route: product/flagship-smartphone.

      Best Practices for Using Design Layout Overrides

      • Plan Ahead: Sketch your desired layouts and identify which pages need overrides.
      • Use Descriptive Names: Name your layouts meaningfully to avoid confusion.
      • Test Thoroughly: Always test your layouts on different devices and browsers.
      • Keep It Modular: Utilize reusable modules to streamline your design process.
      • Backup Regularly: Before making major changes, back up your store to avoid data loss.

      Conclusion

      Design layout overrides in OpenCart 4 provide unparalleled flexibility for customizing your store. By leveraging this feature, you can create unique and engaging shopping experiences tailored to your customers’ needs. With proper planning and implementation, layout overrides can significantly enhance your store’s visual appeal and functionality.

      We hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Webocreation Twitter and Webocreation Facebook. Please let us know if you have any questions or concerns.

      Categories management in Opencart 4

      In this Opencart user manual, we will learn to manage categories in Opencart 4, a fundamental task for organizing your products and improving your store’s navigation. Here’s a step-by-step guide to managing categories from the Opencart admin panel.

      Accessing the Admin Panel

      Log in to the Admin Panel:

      • Navigate to http://yourdomain.com/admin (In Opencart 4, the admin URL can be different as per the installation).
      • Enter your username and password to log in.

      Navigating to Categories Management

      Access Categories:

      • In the admin dashboard, go to Catalog > Categories.
      • This section will display a list of all existing categories.
      Add Opencart category

      Creating a New Category

      Add New Category:

      • Click on the “+” (Add New) button at the top right corner.

      Category Details:

      • General Tab:
        • Category Name: Enter the name of the category.
        • Description: Provide a detailed description of the category. Format the text using the editor and add images if necessary.
        • Meta Tag Title: Enter a title for SEO purposes.
        • Meta Tag Description: Add a meta description for SEO.
        • Meta Tag Keywords: Include relevant keywords for SEO.
      • Data Tab:
        • Parent Category: If this category is a subcategory, select the parent category.
          You can start typing in the Parent and select the parent category.
        • Parent Cateogry
        • Filters: Add filters that apply to this category.
          Read more about Opencart filters
        • Stores: Select the store where this category will be available (useful for multi-store setups).
        • Image: Upload an image representing the category.
        • Top: Choose whether to display this category in the top menu bar. If you don’t check this checkbox it will not show in the Top main menu.
        • Columns: Specify the number of columns to use for the bottom categories.
        • Sort Order: Define the order in which this category appears relative to others.
        • Status: Set the status to “Enabled” to make the category active or “Disabled” to hide it.

          SEO Tab:
        • SEO URL: Create a search engine-friendly URL.  Do not use spaces, instead replace spaces with – and make sure the SEO URL is globally unique.
          Category SEO
      • Design Tab:

      Save Category:

      • Click the “Save” button to create a new category.

      Editing an Existing Category

      Edit Category:

      • In the Categories list, find the category you want to edit.
      • Click the “Edit” button (pencil icon) next to the category name.

      Modify Details:

      • Make necessary changes in the General, Data, and Design tabs.

      Save Changes:

      • Click the “Save” button to update the category.

      Deleting a Category

      Delete Category:

      • In the Categories list, select the checkbox next to the category you want to delete.
      • Click the “Delete” button (trash can icon) at the top right corner.
      • Confirm the deletion when prompted.

      Managing Subcategories

      Creating Subcategories:

      • Follow the steps for creating a new category.
      • In the Data tab, select the appropriate parent category.

      Viewing Subcategories:

      • In the Categories list, subcategories are usually displayed hierarchically under their parent categories.

      Bulk Actions

      Bulk Editing:

      • Select multiple categories by checking the boxes next to their names.
      • Use the bulk actions (e.g. deleting) at the top right corner.

      SEO and Best Practices

      SEO URL Management:

      • Ensure each category has a unique and descriptive SEO URL.
      • Use keywords in the meta tags to improve search engine rankings.

      Optimized Descriptions:

      • Write clear and detailed descriptions for each category, incorporating relevant keywords.
      • Use the editor to enhance descriptions with images and formatted text.

      Category Images:

      • Use high-quality images that represent the category well.
      • Optimize images for fast loading times.

      Managing categories in Opencart from the admin panel is straightforward and crucial for maintaining an organized and user-friendly ecommerce store. By effectively creating, editing, and organizing categories, you enhance the shopping experience for your customers and improve your store’s SEO performance.

       We hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Webocreation Twitter and Webocreation Facebook. Please let us know if you have any questions or concerns.

      Common OpenCart Errors issues and How to Solve Them

      This Opencart tutorial collects the most common errors that we face while developing and provides solutions for errors, try them and hope you could solve the issues

      Cannot delete the admin folder in Opencart 4

      https://forum.opencart.com/viewtopic.php?t=228495&p=843586 This solution looks working, for now, change the following lines of code at admin/controller/common/security.php

      foreach (glob(trim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) {

      to following

      foreach (glob($next . '/{*,.[!.]*,..?*}', GLOB_MARK|GLOB_BRACE) as $file) {

      2. Blank White Pages or 500 Internal Server Error

      Blank white pages are a PHP error that for some reason the error messages don’t show because your server is not set up to display the errors.

      1. Go to the admin>> System >> Setting >> Edit store >> Server tab and at the end where you see the Error handling choose Yes to “Display Errors “.
      2. If you still don’t see the error, open php.ini and add code below: display_errors = 1; error_reporting = E_ALL; log_errors = 1;
      3. If you still don’t see the error then open index.php and add code below at the top (line 2): ini_set(‘display_errors’, 1); ini_set(‘log_errors’, 1); error_reporting(E_ALL);
      4. Still seeing the error then, set your “Output Compression Level” to 0 in the System > Settings > Server tab.
      5. If you still see the error, solve the issues but if you did not see the errors then most probably it will be a Server error.
      6. You can see error logs in the file also if you had enabled it.
        Blank screen issues in Opencart

      Above mostly it gets solved and the 500 Internal Server Error can be solved with a similar approach.

      2. Undefined Index / Variable

      An undefined variable in the source code of a computer program is a variable that is accessed in the code but has not been previously declared by that code. So for that using “isset()” to check if the variable has been set will solve the issue.

      Error variant:

      Notice: Undefined index: filter in /Applications/XAMPP/xamppfiles/htdocs/opencart303/catalog/controller/product/category.php on lin

      Solution
      //$filter = $this->request->get['filter'];
      
      if (isset($this->request->get['filter'])) {
          $filter = $this->request->get['filter'];
      } else {
          $filter = '';
      }
      • Commenting $filter = $this->request->get[‘filter’]; and checking with isset is one way to solve it.
      • If you get the issue while installing the modules or extensions then you need to check the code or solve the issues or contacting the developer can be also another solution.

      3. Undefined Function / Method

      Undefined function/method errors are seen when you call those functions or methods that are not defined and not found. IE_ERROR: A fatal error that causes script termination “Fatal error: Call to undefined function” or “Fatal error: Call to undefined method”. It happens if files are not found or the extensions are not compatible with your OpenCart version. Solutions can be below:

      Error variant:

      Related to OpenCart core files

      • Fatal error: Uncaught Error: Call to undefined method DB\MySQLi::query()
      • Fatal error: Uncaught Error: Call to undefined method Cart\Cart::getProducts() 
      • Fatal error: Uncaught Error: Call to undefined method ControllerAccountLogin::validate() in …/catalog/controller/account/login.php:54 

      Go to the file and check whether the function or methods are defined there.

      4. Headers Already Sent

      Error variant:
      • Warning: Cannot modify header information – headers already sent by (output started at /public_html/config.php:31) in /path/public_html/index.php online.
      Solution:

      Remove spaces at the beginning and end of the file mentioned. Like in the above error check with the config.php

      5. Session Issue

      1. The product on the cart is self-cleared.
      2. The product on the cart is cleared after the user logged in.
      3. No items stored at product compares.
      4. OpenCart admin always asking to login and get message “Invalid token session. Please log in again”.
      Error variant:
      • Warning: session_start () [function.session-start]: open (/tmp/…, O_RDWR) failed: No such file or directory (2) in /path/public_html/system /library /session.php on line
      Solution:

      No such file or directory issue

      1. Open php.ini and add code below:session.save_path = /tmp;
      2. If the solution above does not work, contact your host and ask them how to set session.save_path.

      6. Allowed Memory Size Exhausted

      This error happens because your memory is not enough to execute the PHP code (uploading large images, deleting a lot of products, sending mass emails, etc). Increasing the memory allocated for PHP will solve the issue.

      Error variant:
      • Fatal error: the Allowed memory size of 1111 bytes exhausted (tried to allocate 1111 bytes) in /path/public_html/system/library/image.php on line
      Solution:
      1. Edit php.ini and set memory_limit = 128M;
      2. Or put code below to .htaccess php_value memory_limit 128M
      3. If the above does not works then contacting the hosting providers is only the solution where they can increase the number.

      Warning: Use of undefined constant DIR_STORAGE – assumed ‘DIR_STORAGE’ (this will throw an Error in a future version of PHP) in …/config.php on line

      Some other errors that you can face are below:

      Error: Calls to magic methods are not allowed!

      // Stop any magical methods being called
      if (substr($this->method, 0, 2) == '__') {
      return new \Exception('Error: Calls to magic methods are not allowed!');
      }

      Error: Could not call product/category

      // Initialize the class
      		if (is_file($file)) {
      			include_once($file);
      		
      			$controller = new $class($registry);
      		} else {
      			return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!');
      		}

      Error: Could not load model

      if (!$this->registry->has('model_' . str_replace('/', '_', $route))) {
          $file = DIR_APPLICATION . 'model/' . $route . '.php';
          $class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $route);
      
          if (is_file($file)) {
              include_once($file);
              $proxy = new Proxy();
      	// Overriding models is a little harder so we have to use 
              //  PHP's magic methods
      	// In future version we can use runkit
              foreach (get_class_methods($class) as $method) {
                  $proxy->{$method} = $this->callback($this->registry, $route . '/' . $method);
              }
      
              $this->registry->set('model_' . str_replace('/', '_', (string)$route), $proxy);
          } else {
              throw new \Exception('Error: Could not load model ' . $route . '!');
          }
      }

      Error: Could not load library

      Error: Could not load helper

      Error: Could not load cache adaptor Memcache/Redis/APC cache!

      $class = 'Cache\\' . $adaptor;
      if (class_exists($class)) {
          $this->adaptor = new $class($expire);
      } else {
          throw new \Exception('Error: Could not load cache adaptor ' . $adaptor . ' cache!');
      }

      Error: Could not load database adaptor mpdo/mssql/mysql/mysqli/postgre !

      $class = 'DB\\' . $adaptor;
      if (class_exists($class)) {
          $this->adaptor = new $class($hostname, $username, $password, $database, $port);
      } else {
          throw new \Exception('Error: Could not load database adaptor ' . $adaptor . '!');
      }

      Error: Could not make a database connection using this username and password

      Error: Could not connect to database opencart

      Error: PHP GD is not installed!

      if (!extension_loaded('gd')) {
          exit('Error: PHP GD is not installed!');
      }

      Error: Could not load image filename!

      Error: Invalid session ID!

      Warning: Install folder still exists and should be deleted for security reasons!

      Installed bad extension, pressed refresh in the modification, and both admin panel and site are down

      Remove it from the database, then open config.php and find what is the value defined for storage. Go to that storage/ folder, then go to modification and remove folders, similarly go to upload/ folder and see if there are folders if you have, remove it also. With this, it will remove the cached files and folder. Then, you can access your admin again.

      Fatal error uncaught exception

      Fatal error: Uncaught Exception: Error: Table ‘….oc_session’ doesn’t exist in engine<br />Error No: 1932<br />SELECT `data` FROM `oc_session` WHERE session_id = ‘….’ AND expire > 1548638620 in …/system/library/db/mysqli.php:40 Stack trace: #0 …/system/library/db.php(45): DB\MySQLi->query(‘SELECT `data` F…’) #1 

      For these errors to solve creating a database table will solve most of the issues

      Fatal error: Uncaught Exception: Error: Could not load database adaptor DB_DRIVER!

      Check in the system/library/DB folder whether the required driver file is there.

      https://webocreation.com/twig-cache-removing-while-developing-theme-or-module-developer-tips/

      Hope you solve the problems, if you find them please let us know, then we try to provide the solutions.

      Opencart error, Opencart blank white page, Opencart headers already sent, opencart undefined index, opencart undefined variable, opencart restriction in effect, opencart memory size exhausted, opencart undefined method, opencart undefined function, opencart invalid token session, opencart internal server error, Vqmod, opencart out of memory

      How to add HTML, google analytics, tag manager, third party JS code in Opencart

      In this Opencart tutorial, we are showing you how to add HTML in Opencart, similarly how to add google analytics, google tag manager, Adroll, Facebook pixels, MailChimp conversion code, google ads conversion in success page only, and other third-party JavaScript code in the Opencart, likewise our best way to manage the JavaScript code through google tag manager and test and preview in the google tag manager.

      How to add HTML in the Opencart?

      Opencart has an HTML content module in which you can add the custom HTML in the Opencart and show in any layout you want. Go to admin >> Extensions >> Extensions >> Choose the extension type “Modules”, then look for HTML content and then install it. As HTML content is a multi-instance Opencart module, you can install as many different modules as you want.

      See more: difference between single instance and multi-instance Opencart module

      HTML module content

      Once you install, click the add module button of the HTML content and you will see a form like below:

      add HTML code saving in Opencart

      Click the </> icon then paste the HTML that you have and again click the icon </> and then only the HTML will be saved, else HTML code will not be saved. So be sure to click </> and see WYSIWYG editor and then only click the Save button.

      Now, go to admin >> Design >> Layouts and edit where you want to show the module and then select the positions where to show. Here is a video which shows the layouts and position details of Opencart 3

      How to add google analytics in the Opencart?

      Go to https://google.com/analytics, then log in, choose your accounts and select the “All Web Site Data”, then click in the left menu (1) “Admin”, then to the (2) Tracking Code and then (3) copy the code.

      Google analytics code

      Once you copy the code, go to the Opencart admin >> Extensions >> Extensions >> Choose the extension type “Analytics”. Click the install button.

      Google Analytics Opencart module

      After install click the edit button and you will see the form like below where you can paste the javascript analytics code.

      Google analytics code JavaScript

      Similarly, you can add any third-party JavaScript code here like, the google tag manager, Facebook pixels, MailChimp conversion code, etc.

      How to add conversion code on the success page of Opencart?

      Conversion codes are mostly added on the success page. Here are the steps to add conversions the Opencart way, it may long way but it is Opencart way taking layouts into consideration:

      1. Go to admin >> Extensions >> Extensions >> Choose the extension type “Module” and install the Custom HTML module >> add new >> Enter module name >> Click the </> icon on description >> insert the JavaScript code >> Click the </> icon again >> select Enabled on status >> click Save.
        conversion-code-ads-success-page-opencart
      2. Now, go to admin >> Design >> Layouts
      3. Edit the checkout layout
      4. Change the module name to “Checkout Cart”
      5. In the route field change “checkout/%” to “checkout/cart”
      6. Now, click add a new layout, then enter module name is “Checkout Checkout” and in the route field click “add new” button and add the route as “checkout/checkout” and then click Save.
        Checkout Layout
      7. Similarly, click add a new layout, then enter the module name as “Checkout Success” and in the route field click “add new” button, enter “checkout/success”, then click the add button on the Content Bottom position and select the Conversion code HTML module, then click Save button.
        checkout-success-layout

      8. With the above steps, the conversions code is shown only on the success page.
        conversion-code-at-success-page-only

      In this way, you can add conversion code on the success page only. We made three different layouts because checkout/% took preferences so we cannot create only checkout/success only. Thus we need to create for all of the routes that checkout contains, thus there are three different layouts.

      If you are a developer and using the default theme then you can add the code directly into the code from theme editor. Go to admin >> Design >> Theme Editor >> Choose your store mostly “Default” >> Choose the template “Common” >>then click “success.twig” and add JavaScript code above {{footer}}.

      add code in success twig of Opencart

      How to add custom JavaScript code and custom CSS code in the Opencart Journal theme?

      Go to admin >> Journal >> System >> Settings >> Edit your store >> Then Custom Code >> you can add css and Javascript here.

      Journal theme custom CSS JS

      Our best way to manage third-party JavaScript code is by using Google Tag manager

      We use Google Tag Manager to manage third-party JavaScript code and we think this is the best way because all of our external JavaScript will be on Google Tag manager and we can control a lot of things in google tag manager. Go to http://tagmanager.google.com, sign in, and create an account.

      google-tag-manager-account

      Enter the Account Name, select Country, Container Name, and select Web for a website, then click create button. You will get code to add in your website:

      gtm-code-opencart

      Copy the JS code and go to Opencart admin >> Extensions >> Extensions >> Choose extension type “Analytics”, then install the Google Analytics and edit and you can add the Google tag manager code at the “Google Analytics Code”, enabled it and click save. Once these are done, the google tag manager is installed in Opencart.

      Now in the Google tag manager admin section, click the Tags, then click New, click Triggering, click “All Pages”, after that click the Tag configuration, choose the custom HTML, where you can add any third party JavaScripts.

      Here let’s take an example of MailChimp. Login to the MailChimp, click on the profile, in the dropdown click Connect, then integrations,

      mailchimp custom html tracking

      Then custom website, enter the website URL, and click “Get Code”.

      custom website mailchimp tracking

      You will get like below:

      mailchimp tracking code

      Copy that code and paste that code in the google tag manager Custom HTML like below:

      google tag manager mailchimp

      Click Save. Then submit.

      Save Google Tag Manager

      Enter the version details:

      GTM mailchimp Opencart

      It saved the tag and show details like below:

      Version saved in GTM opencart

      Now your tag is shown in your Opencart store. Likewise, you can add as many third-party JavaScript codes as you want, similarly, you can add code on different pages with the help of triggers.

      In this way, you can add the custom Javascript, custom HTML module, CSS, google analytics, Mailchimp tracking code, google tag manager, etc in the Opencart. Please post your questions or comments or errors so that we can help you. You can follow us at our twitter account @rupaknpl. Subscribe to our YouTube channel for Opencart tutorials, and click to see all Opencart tutorials.

      What is the Order total in Opencart 4? How to apply and create them?

      In Opencart Order total modules are those which decrease or increase the total price of the total order. Some of the order total which decreases the total price are coupons, store credits, reward points, etc. Some of the order totals which increases the total price are Handling fees, low order fees, taxes, etc. You can see order totals by going to Admin >> Extensions >> Extensions >> Choose the extension type Order Totals, then you will see all the order totals. Some of the default order totals are the following: 

      • Coupon
      • Store Credit
      • Handling Fee
      • Klarna Fee
      • Low Order Fee
      • Reward Points
      • Shipping
      • Sub-total
      • Taxes
      • Total
      • Gift Voucher

      How to install the Order total in Opencart?

      Go to Admin >> Extensions >> Extensions >> Choose the extension type “Order Totals” and click the install button that you want to install and Edit it, Enabled it and click Save.

      Order totals affect the total price of order so they are placed in the order total so you will find the order total at the shopping cart page and the confirmation page of the order.

      Order total in Opencart

      Why shipping is not showing in Opencart?

      First, check if the shipping order total is enabled or not. If it is not enabled then we need to enabled it. Next is to check for the Geozone setting of Opencart for the products.

      How to apply and create the Order total in Opencart?

      When we install the Order total modules then it is stored as ‘total’ code in the oc_extension database table. Check the following code how it pulls all the enabled Order total and applied it to the order total costs.

      $results = $this->model_setting_extension->getExtensions('total');
      foreach ($results as $key => $value) {
          $sort_order[$key] = $this->config->get('total_' . $value['code'] . '_sort_order');
      }
      array_multisort($sort_order, SORT_ASC, $results);
      foreach ($results as $result) {
          if ($this->config->get('total_' . $result['code'] . '_status')) {
              $this->load->model('extension/total/' . $result['code']);
              // We have to put the totals in an array so that they pass by reference.
              $this->{'model_extension_total_' . $result['code']}->getTotal($total_data);
          }
      }

      We hope this post may help you understand the Order total of Opencart 3. Let us know if you have any questions or suggestions, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Twitter and Facebook. Enjoy!

      How to install and create Opencart 4 theme – user manual and developer guide?

      With the launch of Opencart 4 and lots of changes, today we are showing how we can install the Opencart 4 theme and how to create the Opencart 4 theme admin section. How to install is the Opencart user manual, and we will go through all the code for the developer guide. For demo purposes we are showing you the admin section in this tutorial and in the next upcoming Opencart 4 tutorial, we will go through Opencart frontend settings and codes.

      How to install the Opencart 4 theme?

      Once you download the above, you will get a zip file named webocreation4.ocmod.zip, then go to Opencart admin >> Extensions >> Installer >> Click the blue upload button. Once the upload is completed, it will list in the Installed Extensions, when you can click the install green button.

      Install Opencart 4 theme

      Now, go to Extensions >> Extensions >> Choose the extension type >> Themes

      Uninstall Opencart 4 theme and custom theme

      Click the green install button on the new theme, and you can uninstall the old one. Then, click the blue edit button and change the status to enable, and click Save.

      Enable Opencart 4 theme

      With these, your new Opencart 4 theme is active.

      How to uninstall the Opencart 4 theme?

      Login into Opencart admin, then Extensions >> Installer >> Find the theme and click Uninstall. If you totally want to remove it then you can delete it.

      File and folders structure of the Opencart 4 theme

      Now all theme files and folders also reside in the extension folder. The theme folder should be inside the theme folder. Here is one example of how the admin files and folders reside, overall our main theme folder is named “webocreation4” and all the files are named as standard.***. You can name them as you like.

      opencart 4 custom theme

      Admin Language of custom Opencart 4 theme

      Let’s start by creating the language file for the Opencart 4 theme. Create files and fodlers like extension >> webocreation4 >> admin >> language >> en-gb >> theme >> theme_standard.php. Here is one simple example of texts added for our custom theme.

      <?php
      // Heading
      $_['heading_title'] = 'Webocreation Theme';
      // Text
      $_['text_extension'] = 'Extensions';
      $_['text_success'] = 'Success: You have modified the Webocreation theme!';
      $_['text_edit'] = 'Edit Webocreation Theme';
      // Entry
      $_['entry_status'] = 'Status';
      // Error
      $_['error_permission'] = 'Warning: You do not have permission to modify the Webocreation theme!';
      

      Admin View of custom Opencart 4 theme

      Create a new file at extension >> webocreation4 >> admin >> view >> template >> theme and create theme_standard.twig. Paste following code. Most of the code are similar to other modules.

      “Check the Select field name, which is name=”theme_standard_status” the name of all settings for theme should start with theme_ and then with the file name, as our file name is standard.php so each field name should start with theme_standard_

      {{ header }}{{ column_left }}
      <div id="content">
        <div class="page-header">
          <div class="container-fluid">
            <div class="float-end">
              <button type="submit" form="form-theme" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fas fa-save"></i></button>
              <a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fas fa-reply"></i></a></div>
            <h1>{{ heading_title }}</h1>
            <ol class="breadcrumb">
              {% for breadcrumb in breadcrumbs %}
                <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
              {% endfor %}
            </ol>
          </div>
        </div>
        <div class="container-fluid">
          <div class="card">
            <div class="card-header"><i class="fas fa-pencil-alt"></i> {{ text_edit }}</div>
            <div class="card-body">
              <form id="form-theme" action="{{ save }}" method="post" data-oc-toggle="ajax">
                <div class="row mb-3">
                  <label for="input-status" class="col-sm-2 col-form-label">{{ entry_status }}</label>
                  <div class="col-sm-10">
                    <div class="form-check form-switch form-switch-lg">
                      <input type="checkbox" name="theme_theme_standard_status" value="1" id="input-status" class="form-check-input"{% if theme_example_status %} checked{% endif %}/>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
      {{ footer }}

      Only we need to make sure that the field names start with theme_standard_, others are similar to other module codes.

      Admin Controller of custom Opencart 4 theme

      Now, let’s create a controller file and folders like extension >> webocreation4 >> admin >> controller >> theme >> theme_standard.php. Now you can add following code, we are describing some important code below:

      <?php
      namespace Opencart\Admin\Controller\Extension\Webocreation4\Theme;
      
      class ThemeStandard extends \Opencart\System\Engine\Controller
      {
          public function index(): void
          {
      
              $this->load->language('extension/webocreation4/theme/theme_standard');
      
              $this->document->setTitle($this->language->get('heading_title'));
      
              $data['breadcrumbs'] = [];
      
              $data['breadcrumbs'][] = [
                  'text' => $this->language->get('text_home'),
                  'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']),
              ];
      
              $data['breadcrumbs'][] = [
                  'text' => $this->language->get('text_extension'),
                  'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme'),
              ];
      
              $data['breadcrumbs'][] = [
                  'text' => $this->language->get('heading_title'),
                  'href' => $this->url->link('extension/webocreation4/theme/theme_standard', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id']),
              ];
      
              $data['save'] = $this->url->link('extension/webocreation4/theme/theme_standard|save', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $this->request->get['store_id']);
              $data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme');
      
              if (isset($this->request->get['store_id'])) {
                  $this->load->model('setting/setting');
      
                  $setting_info = $this->model_setting_setting->getSetting('theme_theme_standard', $this->request->get['store_id']);
              }
      
              if (isset($setting_info['theme_theme_standard_status'])) {
                  $data['theme_theme_standard_status'] = $setting_info['theme_theme_standard_status'];
              } else {
                  $data['theme_theme_standard_status'] = '';
              }
      
              $data['header'] = $this->load->controller('common/header');
              $data['column_left'] = $this->load->controller('common/column_left');
              $data['footer'] = $this->load->controller('common/footer');
      
              $this->response->setOutput($this->load->view('extension/webocreation4/theme/theme_standard', $data));
          }
      
          public function save(): void
          {
              $this->load->language('extension/webocreation4/theme/theme_standard');
      
              $json = [];
      
              if (!$this->user->hasPermission('modify', 'extension/webocreation4/theme/theme_standard')) {
                  $json['error'] = $this->language->get('error_permission');
              }
      
              if (!$json) {
                  $this->load->model('setting/setting');
      
                  $this->model_setting_setting->editSetting('theme_theme_standard_status', $this->request->post, $this->request->get['store_id']);
      
                  $json['success'] = $this->language->get('text_success');
              }
      
              $this->response->addHeader('Content-Type: application/json');
              $this->response->setOutput(json_encode($json));
          }
          public function install(): void
          {
              if ($this->user->hasPermission('modify', 'extension/webocreation4/theme/theme_standard')) {
                  $this->load->model('setting/startup');
                  $this->model_setting_startup->addStartup('theme_theme_standard', 'catalog/extension/webocreation4/startup/theme_standard', 1, 2);
      
              }
          }
      
          public function uninstall(): void
          {
              if ($this->user->hasPermission('modify', 'extension/webocreation4/theme/theme_standard')) {
                  $this->load->model('setting/startup');
      
                  $this->model_setting_startup->deleteStartupByCode('theme_theme_standard');
              }
          }
      }
      

      Now Opencart 4 starts using namespace a powerful concept that provides a way to organize code into groups that allow you to create reusable components that can be reused across multiple projects. So, each Opencart modules, theme, and all extensions now start with a namespace. As we are creating a theme so at the end it is Theme, if you are creating a module, it will be Module, if you are creating an analytics extension then it will be Analytics.

      namespace Opencart\Admin\Controller\Extension\Webocreation4\Theme;

      Now, in the second line, we create the class with the name same as the file, as our file name is standard.php, so we name the class as Standard and inherits the main Opencart controller.

      class ThemeStandard extends \Opencart\System\Engine\Controller

      Now, we create an index method and add the return type

      public function index(): void

      In the index method, all other codes are similar to other modules and extensions, one line of code that you need to look at is below where you add the theme_standard as the first parameter. This first parameter and each field name of the form should start with the same so here in our example is theme_standard

      $setting_info = $this->model_setting_setting->getSetting('theme_standard', $this->request->get['store_id']);

      Another code to look into is below, right now we have one field so it is like below, you need to do similar for each field that you will add. $setting_info holds all the setting that is given by the above getSetting method.

      if (isset($setting_info['theme_standard_status'])) {
          $data['theme_standard_status'] = $setting_info['theme_standard_status'];
      } else {
          $data['theme_standard_status'] = '';
      }

      Another is the save method:

      public function save(): void

      In the same method, look into one main line of code which is like below:

      $this->model_setting_setting->editSetting('theme_standard', $this->request->post, $this->request->get['store_id']);

      The first parameter of editSetting method should be theme_standard.

      Above is the main code that we need to check and change, other similar to all other Opencart 4 modules or extensions or themes.

      public function install(): void
      {
          if ($this->user->hasPermission('modify', 'extension/webocreation4/theme/standard')) {
              $this->load->model('setting/startup');
              $this->model_setting_startup->addStartup('theme_standard', 'catalog/extension/webocreation4/startup/standard', 1, 2);
      
          }
      }

      The above code will add the Startup like below which we will be using in the catalog code, which we will show in the next upcoming post.

      Opencart Startup Theme

      Likewise, we add the uninstall code like below so that all rows are removed from the database

      public function uninstall(): void
      {
          if ($this->user->hasPermission('modify', 'extension/webocreation4/theme/standard')) {
              $this->load->model('setting/startup');
              $this->model_setting_startup->deleteStartupByCode('theme_standard');
          }
      }

      In this way, you can install and create a new custom Opencart 4 theme and create the form in the admin section where you can add the setting for the custom theme. Hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Webocreation Twitter and Webocreation Facebook. Please let us know if you have any questions or concerns. In our next upcoming tutorial, we will go through how to show in the frontend, as now everything is events based so there will be a lot of changes for the new frontend changes of the Opencart 4 custom theme. Please let us know if you have any questions or concerns.

      Popular reports used in eCommerce business, we listed 25 of them

      In Opencart 4 and 3, we can get reports, who’s online, and statistics for sales report, customer transaction report, customer activity report, customer orders report, customer searches report, tax report, shipping report, return reports, sales report, coupons report, products viewed reports, and products purchased report. Login into the admin section and in the left menu you have the Reports menu item, click it and you will see Reports page where you can choose the report type and see the data.

      In the world of e-commerce, reports and analytics play a crucial role in providing valuable insights into business performance, customer behavior, and market trends. Here are 25 popular e-commerce reports that businesses commonly use to monitor and optimize their operations:

      Sales Performance Report

      • Description: Tracks total sales over a specific period.
      • Metrics: Gross sales, net sales, average order value, total orders.
      • Benefits: Helps gauge overall business performance and sales trends.

      Product Performance Report

      • Description: Evaluates the sales performance of individual products.
      • Metrics: Units sold, revenue generated, return rates, stock levels.
      • Benefits: Helps in inventory management and identifying bestsellers and underperforming products.

      Inventory Turnover Report

      • Description: Measures how quickly inventory is sold and replaced over a period.
      • Metrics: Cost of goods sold (COGS), average inventory.
      • Benefits: Helps in optimizing inventory levels and reducing holding costs.

      In Opencart, you can use the Sales reports to analyze the inventory turnover report

      Sales by Geography Report

      • Description: Analyzes sales performance across different geographic locations.
      • Metrics: Total sales, number of orders, average order value by region.
      • Benefits: Identifies high-performing regions and potential markets for expansion.

      Cart Abandonment Report

      • Description: Tracks the rate at which customers add items to their cart but do not complete the purchase.
      • Metrics: Abandonment rate, recovery rate, average cart value.
      • Benefits: Identifies reasons for abandonment and helps in implementing recovery strategies.

      Traffic and Conversion Report

      • Description: Analyzes website traffic and conversion rates.
      • Metrics: Total visitors, unique visitors, conversion rate, bounce rate.
      • Benefits: Helps in understanding website performance and optimizing the user experience.

      Customer Demographics Report

      • Description: Provides insights into the demographic profile of customers.
      • Metrics: Age, gender, location, income level.
      • Benefits: Aids in tailoring marketing strategies and product offerings to target audiences.

      Profit Margin Report

      • Description: Calculates the profitability of the business or individual products.
      • Metrics: Gross profit, net profit, profit margin percentage.
      • Benefits: Helps in pricing strategy and cost management.

      Return and Refund Report

      • Description: Tracks the rate of returns and refunds.
      • Metrics: Number of returns, refund amount, return rate by product/category.
      • Benefits: Identifies issues with product quality or customer satisfaction.

      Customer Feedback and Reviews Report

      • Description: Summarizes customer reviews and feedback.
      • Metrics: Average rating, number of reviews, sentiment analysis.
      • Benefits: Provides insights into customer satisfaction and areas for improvement.

      Subscription and Recurring Revenue Report

      • Description: Tracks revenue from subscription-based products or services.
      • Metrics: Monthly recurring revenue (MRR), churn rate, customer lifetime value.
      • Benefits: Helps in forecasting revenue and managing subscription growth.

      Discount and Promotion Effectiveness Report

      • Description: Measures the impact of discounts and promotions on sales.
      • Metrics: Revenue generated, number of orders, profit margins during promotions.
      • Benefits: Assesses the effectiveness of promotional strategies.

      Mobile vs. Desktop Performance Report

      • Description: Compares sales and traffic performance between mobile and desktop users.
      • Metrics: Sales by device, conversion rate by device, average order value by device.
      • Benefits: Helps in optimizing the mobile shopping experience.

      Shipping and Fulfillment Report

      • Description: Analyzes the performance of shipping and fulfillment operations.
      • Metrics: Shipping costs, delivery times, order fulfillment rates.
      • Benefits: Identifies areas to improve efficiency and customer satisfaction.

      Affiliates and Partners Performance Report

      • Description: Evaluates the performance of affiliate marketing and partnerships.
      • Metrics: Revenue generated, number of sales, commission costs, ROI.
      • Benefits: Helps in managing and optimizing affiliate programs.

      Customer Segmentation Report

      • Description: Divides customers into different segments based on various criteria.
      • Metrics: Segments based on demographics, purchase behavior, loyalty, and engagement.
      • Benefits: Enables personalized marketing strategies and targeted promotions.

      Sales Forecasting Report

      • Description: Predicts future sales based on historical data and trends.
      • Metrics: Projected sales, growth rates, seasonal trends.
      • Benefits: Assists in inventory planning, budgeting, and resource allocation.

      Wishlist and Saved Items Report

      • Description: Tracks items that customers add to their wishlists or save for later.
      • Metrics: Number of items saved, frequency of wishlist usage, conversion rates from wishlist to purchase.
      • Benefits: Identifies popular products and potential sales opportunities.

      Customer Support and Service Report

      • Description: Analyzes customer support interactions and service quality.
      • Metrics: Number of support tickets, response time, resolution time, customer satisfaction.
      • Benefits: Improves customer service operations and identifies common issues.

      Affiliate Program Performance Report

      • Description: Evaluates the effectiveness of the affiliate marketing program.
      • Metrics: Number of affiliates, sales generated, commissions paid, conversion rates.
      • Benefits: Helps in optimizing the affiliate program and identifying high-performing affiliates.

      Customer Acquisition Report

      • Description: Analyzes the effectiveness of different customer acquisition channels.
      • Metrics: Number of new customers, acquisition cost per channel, conversion rates.
      • Benefits: Identifies the most cost-effective channels for acquiring new customers.

      Customer Lifetime Value (CLV) Report

      • Description: Estimates the total value a customer brings over their entire relationship with the business.
      • Metrics: Average purchase value, purchase frequency, customer lifespan.
      • Benefits: Helps in understanding the long-term value of customers and informs marketing spend.

      Customer Retention Report

      • Description: Measures how effectively a business retains customers over time.
      • Metrics: Repeat purchase rate, churn rate, average order frequency.
      • Benefits: Identifies retention trends and highlights areas for improvement.

      Sales by Channel Report

      • Description: Breaks down sales performance by different sales channels (e.g., online store, marketplaces, social media).
      • Metrics: Revenue per channel, number of orders per channel.
      • Benefits: Helps in optimizing marketing strategies and resource allocation.

      Social Media Engagement Report

      • Description: Analyzes the effectiveness of social media channels in driving engagement and sales.
      • Metrics: Likes, shares, comments, referral traffic, conversion rates from social media, revenue generated from social media campaigns.
      • Benefits: Helps in understanding the impact of social media efforts, optimizing social media strategies, and identifying the most effective platforms for marketing.

      Reports

      Reports in Opencart

      You can choose the following report type:

      • Customer Transaction Report
      • Opencart Customer Activity Report
      • Customer Orders Report
      • Opencart Customer Reward Points Report
      • Customer Searches Report
      • Tax Report
      • Shipping Report
      • Returns Report
      • Sales Report
      • Coupons Report
      • Products Viewed Report
      • Products Purchased Report

      Customer Transaction Report

      Customer Transaction Report Opencart

      In the Customer Transaction report, you can see all the sales reports by customer name, email, customer group, status, and total. You can filter it with Date Start, Customer Name, and Date End.

      Customer Activity Report

      When you enabled the track customers’ activity via the customer reports section at admin >> System >> Settings >> edit the store >> then in the Options tab >> find the Customers Activity and select Yes, then it starts to log the customer activity in the report sections. Checking the code at catalog/controller/event/activity.php, we can see that they add the following comment, IP, and date added for the following:

      • Added or registered customer then it logs with key as “register”
      • Edit customer then it logs with the key as “edit”
      • Edit the password when the customer is logged in with the key as “password”
      • Reset the password when the customer is not logged in with the key as “reset”
      • Login by the customer with key as “login”
      • Forgotten password request by the customer with key as “forgotten”
      • The transaction is added for the customer then it logs with key as “transaction”
      • If the customer is added as Affiliate then it logs with key as “affiliate_add”
      • When you edit the affiliate information then it logs with key as “affiliate_edit”
      • If an address is added for the customer then it logs with key as “address_add”
      • When the address is edited for the customer then it logs with key as “address_edit”
      • When the address is deleted for the customer then it logs with key as “address_delete”
      • Return is added by the customer then it logs with key “return_account”
      • Return is added by the guest buyer then it logs with key “return_guest”
      • The order added by the customer then it logs with key as “order_account”
      • The order added by the guest buyer then it logs with key “order_guest”

      The database table “oc_customer_activity” will have data like below:

      Customer activity database Opencart

      In the report section, you can see the customer activity report as below image:

      Customer activity report opencart

      Customer Orders Report

      You can see the Customer orders report in Opencart, where you can filter out with date start, customer, date end, and status of orders.

      Customer Order report opencart

      Customer Reward Points Report

      Read the post on how reward works in Opencart. Once the reward is applied to the customer then you can see the customer reward points report. The report looks like below where you can filter out by data start, customer, and date end:

      customer reward report Opencart

      Customer Searches Report

      In the “customer searches report” you can see what customers are searching for. You can filter the report by date start, customer, date end, IP and keyword.

      Customer research report

      Tax Report

      You can get the tax report in Opencart. For that go to admin >> Reports >> then choose the Tax report where you will see all the tax details. You can filter out by date start, date end, group by days or weeks or months or years, and status.

      Tax report Opencart

      Shipping Report

      You can see the shipping report which you can filter out by date start, date end, group by days or weeks or months or years, and status.

      Shipping report Opencart

      Returns Report

      You can see the post for how product returns are handled in Opencart 3, you can see the returns report and filter out with date start, date end, group by days or weeks or months or years, and status.

      Return reports Opencart

      Sales Report

      You can see the sales report on Opencart 3. You can filter out by date start, date end, group by days or weeks or months or years, and status.

      Sales report Opencart

      Coupon Report

      You can see the coupon report on Opencart 3. You can filter out by date start and date end.

      Coupon report Opencart

      Products Viewed Report

      You can see a Products Viewed Report.

      Products viewed report Opencart

      Products Purchased Report

      You can see a report of products purchased. You can filter it out with date start, date end, and status.

      Products purchased report opencart

      Who’s Online

      You can track customers online via the customer reports section and see who is online right now. To activate the customer online report go to admin >> System >> Settings >> Option tab >> Account section and select Yes for customers online.

      who is online opencart settings

      The reports start showing at admin >> Reports >> Who’s online.

      who is online opencart report

      Statistics

      You can see the overall statistics of the order sales, order processing, orders complete, returns, out-of-stock products, and pending reviews in the statistics report.

      Statistics report

      Opencart 4 and 3 has lots of reportings, it is in the Reports section and some are available in the admin dashboard as well. But still, there are some functionalities that are missing like exporting on CSV or excels, reporting on charts and sometimes the best report of what visitors are doing on your website is tricky, however, to get the best reporting we would recommend you use Google analytics enhanced reporting as well so that you can analyze what visitors and customers are doing in your website and get best decisions. In this way, you can see reporting in Opencart 4 and 3. Please don’t forget to post your questions or comments. Additionally, this will allow us to add extra topics. You can follow us at our Twitter account @rupaknpl, subscribe to our YouTube channel for Opencart tutorials, and click to see all Opencart user manuals.

      25 website security measures for eCommerce developer – Opencart

      In this Opencart tips and tricks, we are showing you 25 Opencart security tactics to make Opencart’s website secure by providing a cheat sheet for Opencart eCommerce users, so that the customers can buy products confidently which may increase your conversion rates. Here are the 25 lists of things that you can do to make the Opencart website secure:

      Use good and secure hosting

      Research and buy good, reliable, and secure hosting.

      Check if the install/ folder is still there

      Once Opencart is installed, you need to remove/delete the install/ folder. Renaming the folder will also have a security hole. Thus, always delete the install/ folder.

      Proper Security settings in the admin

      Login to the admin section >> System >> Settings >> Edit required store >> then in the Server tab, select the use SSL to Yes

      Security setting for Opencart

      Use SSL: To use SSL check with your host if an SSL certificate is installed and add the SSL URL to the catalog and admin config files.

      Allow Forgotten Password: Allow forgotten passwords to be used for the admin. This will be disabled automatically if the system detects a hack attempt.

      Use Shared Sessions: Try to share the session cookie between stores so the cart can be passed between different domains.

      Encryption Key: Please provide a secret key that will be used to encrypt private information when processing orders.

      Use HTTPS/SSL Certificate

      Selecting SSL to Yes on the above setting will not give you an HTTPS URL, your server also need to have SSL installed. Nowadays most servers provide free encrypt SSL certificates which can be setups with just some clicks, or you can use more secure SSL certificates.

      One thing you need to take care of is all of your URL links need to start with HTTPS:// instead of HTTP:// else it will not be fully secured. If you are using external URLs, make sure they start with HTTPS://. With proper SSL installation, your URL will look like the below when you clicked on the SSL icon:

      Connection is secure in Opencart

      Protect your storage/ folder and other files like the config.php file and admin/config.php

      Keep storage/ folder outside of the public_html folder. In the image below, my storage folder is v3storage. Similarly, check your file permission and keep it below 0644.

      Secure storage folder in Opencart

      Use the latest PHP version

      See the chart the PHP V5.6 is already at the end of its life which means there will be no update of security, and they are exposed to unpatched security vulnerabilities. So for security always use the latest version of PHP.

      End of life of PHP version chart
      https://www.php.net/supported-versions.php

      Watch this session, on how the creator of PHP describes the performance in PHP 7. Performance always good impact.

      Use Anti-fraud extension

      Opencart by default provides some Anti-fraud extensions, they help store owner to secure their online e-commerce website from malicious fraudsters and make it more secure. Login to admin >> Extensions >> Extensions >> Choose the extension type as Anti-Fraud >> then you will see lists of modules that you can use. You can use some of them for free like 500 queries/month.

      Anti-fraud opencart extension for free

      Error handling setting

      Enable error logging into the error.log file and it will insert into the database. It is a better idea not to display errors. If you display errors then it will show all full paths of files and it may help hackers. While you perform your debugging errors you can enable it but for security reasons keep it checked as No. You can set the error handling at admin >> System >> Settings >> edit Your Store >> Server tab and you will see the error handling section at the end.

      Error handling in Opencart

      Monitor your admin error logs

      Analyzing error logs also gives what issues are happening and fixing them is important. Similarly, check logs at admin >> Extensions >> Modifications >> Log tab. Fixing errors makes the site more secure.

      Block bad bots

      Opencart provides settings for Robots. You can get it at admin >> System >> Settings >> Edit Your Store >> Server tab and you can see the Robots field. A list of web crawler user agents that shared sessions will not be used with. Use separate lines for each user agent.

      Robots in Opencart

      You can use the following:

      abot
      dbot
      ebot
      hbot
      kbot
      lbot
      mbot
      nbot
      obot
      pbot
      rbot
      sbot
      tbot
      vbot
      ybot
      zbot
      bot.
      bot/
      _bot
      .bot
      /bot
      -bot
      :bot
      (bot
      crawl
      slurp
      spider
      seek
      accoona
      acoon
      adressendeutschland
      ah-ha.com
      ahoy
      altavista
      ananzi
      anthill
      appie
      arachnophilia
      arale
      araneo
      aranha
      architext
      aretha
      arks
      asterias
      atlocal
      atn
      atomz
      augurfind
      backrub
      bannana_bot
      baypup
      bdfetch
      big brother
      biglotron
      bjaaland
      blackwidow
      blaiz
      blog
      blo.
      bloodhound
      boitho
      booch
      bradley
      butterfly
      calif
      cassandra
      ccubee
      cfetch
      charlotte
      churl
      cienciaficcion
      cmc
      collective
      comagent
      combine
      computingsite
      csci
      curl
      cusco
      daumoa
      deepindex
      delorie
      depspid
      deweb
      die blinde kuh
      digger
      ditto
      dmoz
      docomo
      download express
      dtaagent
      dwcp
      ebiness
      ebingbong
      e-collector
      ejupiter
      emacs-w3 search engine
      esther
      evliya celebi
      ezresult
      falcon
      felix ide
      ferret
      fetchrover
      fido
      findlinks
      fireball
      fish search
      fouineur
      funnelweb
      gazz
      gcreep
      genieknows
      getterroboplus
      geturl
      glx
      goforit
      golem
      grabber
      grapnel
      gralon
      griffon
      gromit
      grub
      gulliver
      hamahakki
      harvest
      havindex
      helix
      heritrix
      hku www octopus
      homerweb
      htdig
      html index
      html_analyzer
      htmlgobble
      hubater
      hyper-decontextualizer
      ia_archiver
      ibm_planetwide
      ichiro
      iconsurf
      iltrovatore
      image.kapsi.net
      imagelock
      incywincy
      indexer
      infobee
      informant
      ingrid
      inktomisearch.com
      inspector web
      intelliagent
      internet shinchakubin
      ip3000
      iron33
      israeli-search
      ivia
      jack
      jakarta
      javabee
      jetbot
      jumpstation
      katipo
      kdd-explorer
      kilroy
      knowledge
      kototoi
      kretrieve
      labelgrabber
      lachesis
      larbin
      legs
      libwww
      linkalarm
      link validator
      linkscan
      lockon
      lwp
      lycos
      magpie
      mantraagent
      mapoftheinternet
      marvin/
      mattie
      mediafox
      mediapartners
      mercator
      merzscope
      microsoft url control
      minirank
      miva
      mj12
      mnogosearch
      moget
      monster
      moose
      motor
      multitext
      muncher
      muscatferret
      mwd.search
      myweb
      najdi
      nameprotect
      nationaldirectory
      nazilla
      ncsa beta
      nec-meshexplorer
      nederland.zoek
      netcarta webmap engine
      netmechanic
      netresearchserver
      netscoop
      newscan-online
      nhse
      nokia6682/
      nomad
      noyona
      nutch
      nzexplorer
      objectssearch
      occam
      omni
      open text
      openfind
      openintelligencedata
      orb search
      osis-project
      pack rat
      pageboy
      pagebull
      page_verifier
      panscient
      parasite
      partnersite
      patric
      pear.
      pegasus
      peregrinator
      pgp key agent
      phantom
      phpdig
      picosearch
      piltdownman
      pimptrain
      pinpoint
      pioneer
      piranha
      plumtreewebaccessor
      pogodak
      poirot
      pompos
      poppelsdorf
      poppi
      popular iconoclast
      psycheclone
      publisher
      python
      rambler
      raven search
      roach
      road runner
      roadhouse
      robbie
      robofox
      robozilla
      rules
      salty
      sbider
      scooter
      scoutjet
      scrubby
      search.
      searchprocess
      semanticdiscovery
      senrigan
      sg-scout
      shai'hulud
      shark
      shopwiki
      sidewinder
      sift
      silk
      simmany
      site searcher
      site valet
      sitetech-rover
      skymob.com
      sleek
      smartwit
      sna-
      snappy
      snooper
      sohu
      speedfind
      sphere
      sphider
      spinner
      spyder
      steeler/
      suke
      suntek
      supersnooper
      surfnomore
      sven
      sygol
      szukacz
      tach black widow
      tarantula
      templeton
      /teoma
      t-h-u-n-d-e-r-s-t-o-n-e
      theophrastus
      titan
      titin
      tkwww
      toutatis
      t-rex
      tutorgig
      twiceler
      twisted
      ucsd
      udmsearch
      url check
      updated
      vagabondo
      valkyrie
      verticrawl
      victoria
      vision-search
      volcano
      voyager/
      voyager-hc
      w3c_validator
      w3m2
      w3mir
      walker
      wallpaper
      wanderer
      wauuu
      wavefire
      web core
      web hopper
      web wombat
      webbandit
      webcatcher
      webcopy
      webfoot
      weblayers
      weblinker
      weblog monitor
      webmirror
      webmonkey
      webquest
      webreaper
      websitepulse
      websnarf
      webstolperer
      webvac
      webwalk
      webwatch
      webwombat
      webzinger
      whizbang
      whowhere
      wild ferret
      worldlight
      wwwc
      wwwster
      xenu
      xget
      xift
      xirq
      yandex
      yanga
      yeti
      yodao
      zao
      zippp
      zyborg

      You can set it in the .htaccess file like below as well, if you are using Nginx then you need to write code that returns 403 or so.

      RewriteCond %{HTTP_USER_AGENT} ^.*(agent1|Wget|Catall Spider).*$ [NC]
      RewriteRule .* - [F,L]

      Allowed File extensions and allowed file mime types permissions

      Opencart by default has options to restrict file extensions and file mime types.

      Files security in Opencart

      Allowed File Extensions: Add which file extensions are allowed to be uploaded. Use a new line for each value.

      zip
      txt
      png
      jpe
      jpeg
      jpg
      gif
      bmp
      ico
      tiff
      tif
      svg
      svgz
      zip
      rar
      msi
      cab
      mp3
      qt
      mov
      pdf
      psd
      ai
      eps
      ps
      doc

      Allowed File Mime type: Add which file mime types are allowed to be uploaded. Use a new line for each value.

      text/plain
      image/png
      image/jpeg
      image/gif
      image/bmp
      image/tiff
      image/svg+xml
      application/zip
      "application/zip"
      application/x-zip
      "application/x-zip"
      application/x-zip-compressed
      "application/x-zip-compressed"
      application/rar
      "application/rar"
      application/x-rar
      "application/x-rar"
      application/x-rar-compressed
      "application/x-rar-compressed"
      application/octet-stream
      "application/octet-stream"
      audio/mpeg
      video/quicktime
      application/pdf

      Be sure there are no PHP and JS. In this way, you can secure your file upload buttons.

      Review All Users, User group and Grant the Minimum Permissions Necessary

      Go to admin >> System >> Users and see all users and verify what user group is assigned. Then check all User groups and see what access permission and modification permissions are given. Try to grant the minimum permissions as necessary. In Opencart you can make as many User groups as you want.

      Use a strong username and password

      Set a strong password. Better not to use admin as a username.

      Opencart V3 has Max Login Attempts

      Maximum login attempts are allowed before the account is locked for 1 hour. Customer and affiliate accounts can be unlocked on the customer or affiliate admin pages.

      max login attempts in Opencart

      It is available only on Opencart v3 but you can implement this by following the tutorials at https://forum.opencart.com/viewtopic.php?t=218405#p790296

      Two-factor Authentication free module

      You can use this free two-factor authentication.

      https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=32882

      API security in Opencart

      Similarly, check your API access as well. Go to admin >> System >> Users >> API and review all your API usernames and set proper API usernames, API keys, and IP addresses.

      API security in Opencart

      Always use the latest Opencart version, theme, modules, and extensions

      It is better to use the latest Opencart version, theme, modules, and extensions. You may get problems getting the upgraded version of your custom modules and extensions but if you don’t update it then you risk the security.

      Remove unused modules or extensions

      Login to admin >> Extensions >> Installer >> you can see a list of modules that are installed. Remove unused modules or extensions. Similarly verify if old files and folders are remaining, especially for custom modules and themes.

      Don’t use nulled Opencart theme or modules or extensions

      Choose trustworthy plugins and theme providers, it can cost you some but it will protect you a lot.

      Monitor your server logs as well

      If you are using CPanel hosting then you can check the Resources Usage at Login to Cpanel >> Metrics >> Resources Usage >> Snapshots. You can check that resource limits are being reached, resulting in slow performance or errors. Often resource issues are due to scripting/plugins on your site, development work such as making changes, or an increased amount of traffic. You and your web developer can review the resource usage of your account and take steps to reduce the load. Some scripts which are running long by some IP address means there is some fishy going on, so make sure to keep on checking it and see if you can improve your code and scripts.

      Resource Usage fix of Opencart

      Free Opencart website security check & malware scanner

      You can check your website security and malware at https://sitecheck.sucuri.net/

      no malware found, security check at Opencart

      Use HTTP security headers

      You can get your HTTP security headers to report at https://securityheaders.com/

      HTTP security headers check report

      Cross-Site Scripting (XSS)

      If the programmer is tricky then in Opencart it is easy to add the JS script which may easily cause Cross-Site Scripting. Cross-Site Scripting (XSS) is when a malicious script is injected into a trusted website or application. The attacker uses this to send malicious code, typically browser-side scripts, to the end-user without them knowing it. The purpose is usually to grab cookies or session data or perhaps even rewrite HTML on a page. Go to admin>> Extensions >> Extensions >> Choose the Extensions Type as “Analytics” and see in the Google Analytics code field, if only required JS codes are added. If you see suspicious JS code then better to remove it.

      Database Security and SQL Injections

      Always use a strong database username and strong password. You can check this at config.php and admin/config.php, if you don’t have then you need to change to a strong password and username.

      Similarly, if you are using custom modules and there are database queries then you need to verify whether the queries are written properly, whether all the fields are escaped properly or not and so.

      One example of how they can inject the extra queries if you don’t escape the fields is below:

      YOUR_OTHER_QUERIES_customerid=0&directory=%2Febooks%2F1115.pdf&model=1115%27%2F%2A%2A%2FAND%2F%2A%2A%2FEXTRACTVALUE%282030%2CCONCAT%280x5c%2C0x4c634d6c%2C%28SELECT%2F%2A%2A%2FMID%28%28IFNULL%28CAST%28email%2F%2A%2A%2FAS%2F%2A%2A%2FNCHAR%29%2C0x20%29%29%2C1%2C22%29%2F%2A%2A%2FFROM%2F%2A%2A%60.%%60%2F%2A%2A%%2F%2A%2A%2FBY%2F%2A%2A%2F%%60%2F%2A%2A%2FLIMIT%2F%2A%2A%2F8570%2C1%29%2C0x4c634d6c%29%29%2F%2A%2A%2FAND%2F%2A%2A%2F%276538%27%3D%276538&modelfinal=EREM+1115&order_id=30572&product_id=3389

      See that bold section in the above queries, another query is concatenated and SQL injected is done.

      Denial of Service

      This is the most dangerous vulnerability, Denial of Service (DoS) exploits errors and bugs in the code to overwhelm the memory of website operating systems. Hackers have compromised millions of websites and raked in millions of dollars by exploiting outdated and buggy versions of Opencart software with DoS attacks. The hackers keep on running the code and your server CPU usage will be 100%, your server’s Physical Memory Usage is full and the website will not be available for real users or customers.

      One of the best recommendations is to use a reputable 3rd party security service like Cloudflare or Sucuri and be sure to use the code and scripts properly.

      Back up

      Be sure to make as much backup as possible.

      Use Google Captcha or Basic Captcha

      Using Google Captcha or basic captcha on the form also helps you remove spam and get emails that contain vulnerable links.

      These are some of the securities cheat sheets for Opencart. Please let us know if you are using any other tactics to make the Opencart website secure. Hope you liked this article, please subscribe to our YouTube Channel for Opencart video tutorials. You can also find us on Twitter and Facebook. Happy learning.

      Opencart multi-websites or store setup

      Opencart multiple websites. It can handle multiple stores with one Opencart installation. Creating a Multi-Store Opencart allows for multi-store management using only one installation. If you have installed Opencart into at least one store, you can add multiple stores to your admin panel without having to repeat the installation process. To add a new store you must first create a subdomain in your cPanel, then add the store in the Settings section of the admin panel.

      Multistore Opencart

      OpenCart 4 allows you to manage multiple online stores from a single admin interface. This multi-site capability is particularly useful for businesses that operate in different regions, sell various product lines, or want to create separate storefronts for different customer segments. Setting up multiple sites in OpenCart is straightforward and provides a centralized way to control and monitor all your stores.

      Benefits of a Multisite Setup

      • Centralized Management: Manage multiple stores from a single admin dashboard. One admin management with one log in for products, categories, customers, orders, design, etc
      • Shared Resources: Use the same product catalog, customer database, and settings across multiple stores. You can configure each product to show on which store and can set different prices for the same product
      • Customized Storefronts: Tailor the appearance and functionality of each store to target specific audiences. Although having one admin management, you can have different layouts and different themes for different stores
      • Cost-Effective: Save on infrastructure and maintenance costs by running multiple stores on the same installation.
      • Customer easiness: Customers can have a single sign-on for different stores that are managed on multiple.

      Prerequisites

      Before setting up multiple stores, ensure you have the following:

      • A working installation of OpenCart 4 on the server (In our example we are using demo.webocreation.com)
      • Administrative access to the OpenCart admin panel.
      • Domain names or subdomains for each store, both the server and 
      • DNS Domain name server settings
      • You use the addon domain in cpanel to add the 2nd domain to your hosting account. Then change the document root in that 2nd domain to be the same as your first store – the folder opencart is installed in. Add the store to opencart settings and done.
      • Point their A records to the IP of your server.
      • Associate them with that hosting account which can be done in cPanel via “Aliases” which used to be called “Parked Domains” if I remember correctly.

      Example stores

      Main store: https://demo.webocreation.com
      First Store 1: https://demo2.webocreation.com
      Second Store 2: https://demo3.webocreation.com
      Third Store 3: https://dpsignadvertising.com 

      Step-by-Step Guide to Setting Up Multisite in OpenCart 4

      Step 1: Configure Your Domain/Subdomain

      First, set up your additional domains or subdomains. This process will vary depending on your hosting provider but generally involves the following steps:

      • DNS management: Access to domain registrar admin section so you can point domain A records to the server. In this example, we are using Cloudflare DNS so we added the A records like below, as in this example we are using sub-domain demo2.webocreation.com and demo3.webocreation.com, so pointed the A record to the IP address.
        A type
        Fig: 2

      For main domains like dpsignadvertising.com, you need to delegate the same name server that you are using for the opencart installed server, here is https://demo.webocreation.com, so for dpsignadvertising.com, we add the same ns1 and ns2 as demo.webocreation.com

      DNS settings

      Fig: 12.3 

      • Subdomains: Create subdomains (e.g., store1.yourdomain.com, store2.yourdomain.com) and point them to the OpenCart installation directory.

      Domains Settings
      Fig: 12.4

      Then click “Create a New Domain” enter the domain URL and submit, here we entered demo3.webocreation.com

      Domains new settings

      Similarly, you can enter as many domains as needed.

      Domains listing
      • Domains: Same as sub-domains, point each domain to the root directory of your OpenCart installation. We are using the cPanel so we find the domain section, for us here is an example, click in the Domains and enter the domains.
        Domains listing

      2: Add New Stores in OpenCart Admin

      1. Log in to Admin Panel: Log in to your OpenCart admin dashboard.
      2. Navigate to Store Settings: Go to System -> Settings.
      3. Add New Store:
        • Click the “+” button to add a new store.
        • Store Name: Enter the name of the new store.
        • Store URL: Enter the URL of the new store, including the trailing slashLog in., https://dpsignadvertising.com/).

      If you forget the trailing slash multi-store will not work

      3: Configure Store Settings

      1. General Settings: Configure general settings such as store name, owner, address, email, and phone number. You can select different themes, logos, and layouts for each store
      2. Local Settings: Set local settings like country, region, language, and currency for the new store.
      3. Option Settings: Set all settings like products, legal, etc for the new store.
      4. Image Settings: Enter the image sizes

      4: Customize Your Store

      1. Themes: Go to Design -> Themes and select a theme for your new store. You can choose to use the same theme as your main store or a different one.
      2. Layouts: Customize the layouts for your new store by navigating to Design -> Layouts. Adjust the positions and modules according to your requirements.
      3. Banners and Sliders: Set up banners and sliders specific to the new store under Design -> Banners.

      5: Assign Products and Categories

      1. Products: Navigate to Catalog -> Products and edit each product to assign it to the new store. Use the “Stores” tab to select the stores where the product should be visible.
      2. Categories: Go to Catalog -> Categories and assign categories to the new store using the “Stores” tab.

      6: Test Your Store

      1. Access the Store URL: Open a web browser and navigate to the URL of your new store.
      2. Verify Functionality: Ensure that all links, images, and functionalities are working correctly.
      3. Place a Test Order: Complete a test purchase to verify that the checkout process is functioning correctly.

      Setting up a multisite environment in OpenCart 4 is an efficient way to manage multiple online stores from a single admin interface. By following the steps outlined above, you can configure and customize each store to meet the needs of different markets or customer segments. This powerful feature of OpenCart helps streamline operations, reduce costs, and expand your business reach effectively.

      How to Change OpenCart Timezone

      This tutorial covers how to change the timezone in OpenCart as well as change time of the database.

      Go to system/startup.php and find following lines of code:

      if (!ini_get('date.timezone')) {
      	date_default_timezone_set('UTC');
      }

      Replace with following lines of code by changing to your timezone

      date_default_timezone_set('Australia/Sydney');

      Synchronize PHP and Database Timezone

      The query we use to set database timezone if you are super admin is below:

      SET time_zone='offset';

      But everyone has no super admin access so need to change in the code level. For that go to system/library/db/mysqli.php if you are using MySQLi and add code below after $this->connection->query(“SET SQL_MODE = ””);

      $dt = new \DateTime();
      $this->connection->query("SET time_zone='" . $dt->format('P') . "';");

      With these changes your timezone in Opencart are changed.

      Let us know if you find any issues, thanks a lot.

      Unlock Global Opportunities with Google Market Finder

      Expanding your business internationally can seem daunting, but what if there was a tool to make it simple, insightful, and actionable? Enter Google Market Finder – a free and intuitive resource designed to help businesses identify untapped markets, gather crucial operational insights, and reach new customers worldwide. Whether you’re a seasoned global seller or just starting your export journey, this tool can be a game-changer. Webocreation just started at Glendale Arizona, so we were checking to expand to California, New York and other states.

      Let’s dive into what makes Google Market Finder so powerful and how it can help your business thrive globally.

      What is Google Market Finder?

      Google Market Finder is a comprehensive tool that provides data-driven insights to help businesses discover new internal and international markets and develop strategies to enter them effectively. By analyzing your website and product offerings, it highlights potential growth opportunities and offers actionable recommendations tailored to your needs.

      With features like operational guides, marketing resources, and analytics dashboards, Google Market Finder goes beyond just identifying markets—it equips you with the knowledge to succeed.

      Why Use Google Market Finder?

      1. Identify High-Potential Markets: Google Market Finder uses search trends and data to recommend markets that show demand for your products or services. For example, if you’re selling eco-friendly home goods, it will pinpoint countries where interest in sustainability is rising.
      2. Operational Guidance: The tool provides step-by-step guidance on logistics, regulations, taxes, and payment methods in your target markets. This reduces guesswork and streamlines your international expansion.
      3. Customized Marketing Insights: Learn how to tailor your marketing efforts for each market. With localized advertising tips, consumer behavior insights, and industry trends, you can create campaigns that resonate with local audiences.
      4. Data-Driven Decisions: The multiple charts and visualizations offered by Google Market Finder are incredibly helpful for spotting opportunities you might have missed. These visuals make complex data easier to understand and act upon.
      5. Free Access: As a free tool, it offers immense value without the need for hefty investments, making it accessible to businesses of all sizes.

      Host Opencart in AWS Lightsail

      How Does It Work?

      1. Enter Your Website or Industry: Start by inputting your website URL and selecting your industry categories from the dropdown menu. For webocreation, we selected E-Commerce & Retail Software and Software.

        Market Insights categories
      2. Potential Markets, Review Market Suggestions: The tool analyzes global data to provide you with a ranked list of potential markets based on demand and competition. Select Potential Markets, for us we selected California, Pennsylvania and New York.
        Potential Markets suggestion

      3. Explore Insights: Click on each suggested market to explore consumer behavior, purchasing habits, and logistical considerations.

        Market Insights Reports
        Read more: eCommerce business reports
      4. Operational Areas: In the Operational Areas, you can access guides on how to navigate legal, tax, and shipping requirements for your chosen markets.
      5. Market your Busineass: Use the provided marketing and advertising tips to reach your new audience effectively.

      Key Features of Google Market Finder

      1. Market Insights:

      Discover where your products are in demand by leveraging Google’s massive data pool. Market Finder highlights search volume, average income, and market competitiveness for each potential market.

      2. Operational Guidance:

      Operational success is crucial when entering a new market. Market Finder provides localized insights into:

      • Shipping logistics
      • Payment methods
      • Legal and tax considerations
      • Customer support best practices

      3. Marketing Tools:

      From understanding cultural nuances to crafting ads in the local language, Market Finder provides detailed advice on how to market your product effectively in each country.

      4. Interactive Charts and Visuals:

      The tool’s intuitive interface presents data through interactive charts, making it easy to understand market trends, compare opportunities, and strategize accordingly.

      Why We Love It

      We used it to explore opportunities for our own business and were impressed by its user-friendly interface and depth of insights. The charts and data visualizations were particularly helpful in highlighting areas we hadn’t considered. For instance, we discovered a growing demand for our products in Southeast Asia, a region we hadn’t previously prioritized. With actionable insights on logistics and consumer preferences, we developed a targeted strategy to enter this market.

      Who Should Use Google Market Finder?

      it is ideal for:

      • Small to Medium-Sized Businesses (SMBs): Looking to explore export opportunities with minimal resources.
      • eCommerce Brands: Aiming to identify international markets for their products.
      • Service Providers: Wanting to expand their client base globally.
      • Marketers: Seeking data-driven insights to refine their global strategies.

      Get Started with Google Market Finder Today

      Expanding into global markets has never been easier, thanks to tools like Google Market Finder. With its data-driven insights, operational guides, and marketing recommendations, you can confidently identify and enter new markets without the typical hurdles of international expansion.

      Ready to unlock your business’s global potential? Try Google Market Finder for free today and discover the opportunities waiting for you around the world.

      Your business’s next big success could be just a market away!

      How to customize the Opencart homepage? version 4

      In this Opencart guide, we are showing how to customize the Opencart 3 homepage and make changes to layouts, and modules, edit homepage content in Opencart 3.

      As the homepage of Opencart is made of modules, to change home page layout in opencart for demo data here are the steps:

      Go to admin >> Design >> Layouts >> Edit the Home Layouts >> you will see similar like below:

      Opencart homepage layout

      You can see which modules are active on the homepage, in the demo data of Opencart 3 there are three modules which are active only in the Content Top layout. These three modules in Opencart are Slideshow module, Featured products module, and Carousel module. You can add and remove the modules as per your requirement in the layouts.

      Where can you find modules in Opencart 3?

      Go to Admin >> Extensions >> Extensions >> Choose the Extension type “Modules”, you will see all the modules here. Now see for the Slideshow module and edit it. You will find the settings for the Slideshow like in the image below:

      Slideshow settings of Opencart

      You can select the banner, give width and height and change the status. Likewise, you can make changes in the Featured products module and Carousel module. Similarly, you can activate the modules that you want to show on the home page, enable it. Then, add in the layouts. You can see the following video to install the module, configure it, uninstall it and remove it:

      If you want to understand more about the layouts and positions then here are opencart layouts explained video:

      Once you see the videos above then you understand how you can install, configure, uninstall and remove the module and understand how layout and position work in Opencart 3 by which you can make changes to any Opencart page and customize as per your need.

      Please let us know if you have any questions or concerns. Please don’t forget to post your questions or comments so that we can add extra topics. You can follow us at our twitter account @rupaknpl and subscribe to our YouTube channel for opencart tutorials.

      Opencart 4 Events by Examples – Opencart Tutorial

      In this Opencart tutorial, we go through OpenCart Events. Opencart events are hooks that developers can attach custom code to, allowing them to execute specific actions at different points in the application’s lifecycle. Events can be triggered by various actions within the OpenCart system, such as user authentication, order creation, product editing, email sending, and more.

      Event Types

      Pre-Events:

      Triggered before a specific action occurs. For example, a pre-event can be triggered before an order is saved, allowing developers to perform custom actions like validating order data.

      Post-Events:

      Triggered after a specific action occurs. For example, a post-event can be triggered after a product is edited, allowing developers to perform custom actions like updating related data. 

      Using OpenCart Events:

      To use OpenCart events, developers need to create an event listener, which is a function or method that responds to a specific event. An event completes the tasks that a controller, a model, a theme override, a language, and a config need to be achieved in the back-end of the store. Upon startup, the Engine automatically registers triggers, actions, and sorts orders in both the admin/controller/startup/event.php and catalog/controller/startup/event.php files.

      Event listeners are registered using the addEvent method from the Event class. The method takes three parameters: the event name, the class/method to be executed, and the priority of the listener.

      Example Code:

      // In your custom extension, add this code to the controller
      $this->event->addEvent('catalog/controller/product/product/after', 'extension/event/custom_event/afterProductView');
      
      // Define the event listener in your custom event class
      class ControllerExtensionEventCustomEvent extends Controller {
          public function afterProductView(&$route, &$data, &$output) {
              // Custom code to execute after a product view
              // Example: modify the product data before it's rendered
              $data['custom_text'] = 'This is a custom message after product view.';
          }
      }

      Registering Events:

      Events can be registered in an extension’s install method or directly in the controller if needed.

      It’s important to unregister events in the extension’s uninstall method to avoid any unwanted behavior after removing the extension.

      Using Events for Customization:

      Developers can use OpenCart events to customize and extend the platform in various ways, such as:

      Adding custom logic to product pages, checkout processes, or other areas of the platform.

      Modifying data before it’s displayed to the user.

      Integrating with third-party services or APIs.

      For developers, add event code, description, trigger, and action in the database. The action is the method that does what you want. The trigger is the path that you want for the existing Opencart controller and methods.

      You can see all the events at >> Admin >> Extensions >> Events

      Opencart events list

      List of Events

      Catalog and administer events. Here are the lists of Catalog events for different functionalities.

      Language events

      OpenCart’s language events system is an important part of managing and customizing language-related aspects of the platform. Language events allow developers to add, modify, or manipulate language files and translations within the OpenCart application. This is crucial for providing multilingual support and customizing the text displayed to users.

      view/*/beforeDump all the language vars into the template.
      controller/*/beforeBefore the controller loads stores all current loaded language data
      controller/*/afterAfter the controller loads and stores all current loaded language data

      Activity events

      OpenCart’s activity events system allows developers to monitor and respond to user activities and other important events within the platform. These events are useful for tracking user actions, generating logs, and performing custom operations based on specific activities. This system enhances the ability to understand user behavior, provides better support, and maintains the platform effectively.

      Here’s an overview of OpenCart activity events and how you can use them:

      Understanding Activity Events:

      Activity events in OpenCart track significant actions performed by users, such as login, logout, product views, purchases, and more.

      These events enable developers to create custom responses and logs based on specific user activities.

      Common Activity Events:

      customer_login: Triggered when a customer logs in. This event is useful for monitoring login activity or taking specific actions upon login.

      customer_logout: Triggered when a customer logs out. You can use this event to perform cleanup operations or logging.

      product_viewed: Triggered when a product is viewed. Useful for tracking product popularity or taking custom actions based on product views.

      order_added: Triggered when a new order is added. This event can be used to log order information or trigger post-order processes.

      customer_register: Triggered when a customer registers a new account. Useful for sending welcome emails or performing other onboarding activities.

      Creating Activity Event Listeners:

      To use activity events, create event listeners that respond to specific events of interest.

      Register event listeners in your extension’s controller using the addEvent method from the Event class.

      // Registering an activity event listener in your controller
      $this->event->addEvent('customer_login', 'extension/event/activity/onCustomerLogin');
      
      // Define the event listener method in your custom event class
      class ControllerExtensionEventActivity extends Controller {
          public function onCustomerLogin(&$route, &$args, &$output) {
              // Custom code to execute when a customer logs in
              // For example, log the customer login event
              $this->log->write('Customer logged in: ' . $args['customer_id']);
          }
      }
      

      Default Opencart Activity Event list:

      catalog/model/account/customer/addCustomer/after
      catalog/model/account/customer/editCustomer/after
      catalog/model/account/customer/editPassword/after
      catalog/model/account/customer/deleteLoginAttempts/after
      catalog/model/account/customer/editCode/after
      catalog/model/account/customer/addTransaction/after
      catalog/model/account/affiliate/addAffiliate/after
      catalog/model/account/affiliate/editAffiliate/after
      catalog/model/account/address/addAddress/after
      catalog/model/account/address/editAddress/after
      catalog/model/account/address/deleteAddress/after
      catalog/model/account/returns/addReturn/after
      catalog/model/checkout/order/addHistory/before

      Statistics events

      catalog/model/catalog/review/addReview/after
      catalog/model/account/returns/addReturn/after
      catalog/model/checkout/order/addHistory/before

      Theme event

      OpenCart’s theme events system allows developers to customize and extend the behavior of themes within the platform. By using Theme events, you can modify how themes render content, alter page elements, and integrate custom logic to achieve a unique look and feel for your store.

      Here’s an overview of OpenCart theme events and how you can utilize them:

      Understanding Theme Events:

      Theme Events are hooks that allow you to customize the rendering of pages and elements in your OpenCart theme.

      These events are triggered during different stages of the rendering process and provide opportunities to manipulate the data or layout before it’s displayed to users.

      Common Theme Events:

      view/*/before: Triggered before rendering a view file in a specific directory, such as catalog/view/theme/[theme_name].

      view/*/after: Triggered after rendering a view file in a specific directory.

      template/*/before: Triggered before rendering a template file in a specific directory, such as catalog/view/theme/[theme_name]/template.

      template/*/after: Triggered after rendering a template file in a specific directory.

      Creating Theme Event Listeners:

      To use the theme events, you need to create event listeners that respond to the specific events you want to customize.

      Register event listeners in your extension’s controller using the addEvent method from the Event class.

      // Registering a theme event listener in your controller
      $this->event->addEvent('view/common/header/before', 'extension/event/theme/customizeHeader');
      
      // Define the event listener method in your custom event class
      class ControllerExtensionEventThemeCustomizeHeader extends Controller {
          public function customizeHeader(&$route, &$data, &$output) {
              // Custom code to modify the header before rendering
              $data['custom_message'] = 'Welcome to our store!';
          }
      }

      Here are lists of Opencart theme events:

      view/*/before
      view/*/after
      template/*/before
      template/*/after

      Here is the main code for the catalog that controls the theme events: upload/catalog/controller/event/theme.php

      class Theme extends \Opencart\System\Engine\Controller {
      	/**
      	 * Index
      	 *
      	 * @param string            $route
      	 * @param array<int, mixed> $args
      	 * @param string            $code
      	 *
      	 * @return void
      	 */
      	public function index(string &$route, array &$args, string &$code): void {
      		// If there is a theme override we should get it
      		$this->load->model('design/theme');
      
      		$theme_info = $this->model_design_theme->getTheme($route, $this->config->get('config_theme'));
      
      		if ($theme_info) {
      			$code = html_entity_decode($theme_info['code'], ENT_QUOTES, 'UTF-8');
      		}
      	}
      }

      Admin Currency Events

      model/setting/setting/editSetting
      model/localisation/currency/addCurrency
      model/localisation/currency/editCurrency

      Admin Statistics Events

      admin/model/catalog/review/addReview/after
      admin/model/catalog/review/deleteReview/after
      admin/model/sale/returns/addReturn/after
      admin/model/sale/returns/deleteReturn/after

      Translation Event

      OpenCart’s translation events system allows developers to customize and extend the language and translation aspects of the platform. By using translation events, you can modify or extend the existing translations, add new language strings, and customize language files to achieve a more personalized or localized experience for your store. Here is the main code that you can find at upload/catalog/controller/event/translation.php and upload/admin/controller/design/translation.php

      class Translation extends \Opencart\System\Engine\Controller {
      	/**
      	 * Index
      	 *
      	 * @param string $route
      	 * @param string $prefix
      	 *
      	 * @return void
      	 */
      	public function index(string &$route, string &$prefix): void {
      		$this->load->model('design/translation');
      
      		$results = $this->model_design_translation->getTranslations($route);
      
      		foreach ($results as $result) {
      			if (!$prefix) {
      				$this->language->set($result['key'], html_entity_decode($result['value'], ENT_QUOTES, 'UTF-8'));
      			} else {
      				$this->language->set($prefix . '_' . $result['key'], html_entity_decode($result['value'], ENT_QUOTES, 'UTF-8'));
      			}
      		}
      	}
      }

      Admin Language Events

      view/*/before
      controller/*/before
      controller/*/after

      Testing Output with Opencart Events

      By default, in the system/config/catalog.php file, the debug key and value are commented out at the bottom of the file because they should only be active for debugging purposes. Remove the comment from the code like below:

      // Action Events
      $_['action_event']      = [
      	'controller/*/before' => [
      		0 => 'event/modification.controller',
      		1 => 'event/language.before',
      		2 => 'event/debug.before'
      	],
      	'controller/*/after' => [
      		0 => 'event/language.after',
      		2 => 'event/debug.after'
      	],
      	'view/*/before' => [
      		0   => 'event/modification.view',
      		500 => 'event/theme',
      		998 => 'event/language'
      	],
      	'language/*/before' => [
      		0 => 'event/modification.language'
      	],
      	'language/*/after' => [
      		0 => 'startup/language.after',
      		1 => 'event/translation'
      	]
      ];

      After enabling debugging, you can test the code within the catalog/controller/event/debug.php file. You see the after and before methods. Here is an example of an after-method test to find all the routes used on the page.

      Opencart events debugging

      It is essential to undo the changes of the debugging by commenting out the debug line in the system/config/catalog.php file after testing.

      Challenges

      • Performance Impact: Every event adds a layer of processing, which can slightly impact page load times, especially with numerous event handlers. Monitor performance and prioritize essential events to avoid noticeable slowdowns.
      • Debugging Complexity: Debugging problems within event handlers can be more challenging than traditional code because they may be triggered from different locations. Employ proper logging and testing practices to identify and resolve issues effectively.
      • Security Risks: Improper event handler implementation might introduce security vulnerabilities. Always validate and sanitize user input within event handlers to prevent potential security risks.
      • Maintenance burden: As your store and codebase grow, managing numerous event handlers can become complex. Organize your events and handlers logically, document their purpose, and update them regularly to maintain code clarity and avoid conflicts.
      • Version compatibility: While events strive for backward compatibility, updates to core files or other extensions might break event handlers. Thoroughly test your events after updates to ensure continued functionality.

      Best Practices while using Opencart Events:

      • Use events judiciously: Don’t overuse events for simple tasks that can be handled efficiently within core files. Reserve events for extending functionality beyond core capabilities.
      • Write clean and efficient code: Optimize your event handlers for performance and avoid unnecessary processing.
      • Test thoroughly: Test your event handlers under various scenarios, including edge cases and potential conflicts with other extensions.
      • Document your work: Document the purpose and logic of your event handlers to facilitate future maintenance and collaboration.
      • Stay updated: Monitor changes in OpenCart and event-related functionality to adapt your code when necessary.

      Please let us know if you have any questions or suggestions. Please subscribe to our YouTube Channel for Opencart video tutorials, and you can see more in the Opencart tutorial category. You can also find us on Twitter and Facebook. Enjoy!

      Order Statuses management in Opencart 4 – Opencart User manual

      In Opencart 3 we can manage the order statuses. For that go to admin >> System >> Localization >> Order Statuses then click “Add New” and you can enter the Order Status Name. In this section, you can create order statuses that you can use on Payment gateways and manage sales orders. The image below shows default order statuses provided in the Opencart 3:

      Order statuses

      By default, Opencart provided all the possible order statuses but if you want to add a new order status for your requirement. Then click then click “Add New” blue button in the top right and you will get the form like below:

      Order status name opencart

      Enter the order status name and click save and your order status is saved so that you can see it in multiple places like Sales orders, payment gateway settings and many more.

      Order status global setting

      There are some order status settings at admin >> System >> Settings >> edit the store >> click Options tab and go to the checkout section where you can find following order status settings:

      Order status setting Opencart

      Order Status: Set the default order status when an order is processed.

      Processing Order Status: Set the order status the customer’s order must reach before the order starts stock subtraction and coupon, voucher and rewards redemption.

      Complete Order Status: Set the order status the customer’s order must reach before they are allowed to access their downloadable products and gift vouchers.

      Fraud Order Status: Set the order status when a customer is suspected of trying to alter the order payment details or use a coupon, gift voucher or reward points that have already been used.

      Order statuses at Payment gateways

      With the above default settings for order statuses, each payment gateway has its own order statuses settings. Like for example, the PayPal payments standard module supports all the order status like in the below example. If an order is canceled then the logged order status will be Canceled as per the setting below. So don’t forget to set up the order status for the payment gateway that you are using. For that go to admin >> Extensions >> Extensions >> Choose the payments as the extension type, which will list out all the payment gateways that are available and edit the one you are using and check the order status.

      Paypal order status Opencart

      For Cash on Delivery, the order status is only pending as per the setting below as it does not have all other settings support like for the PayPal. So when someone ordered with Cash on Delivery then all order goes to pending then you can change it on Order History.

      cash on delivery order status opencart

      Customer Order status in Order History

      In the image below the order status is shown in the Order history section. To see it go to admin >> Sales >> Orders >> View one of the order. Then in the Order History section, you can see the drop-down of Oder status which you can notify the customer if needed with the order status. If you don’t notify then it will not show in the order history of the customer at the frontend section. Like this the order status is used, so you can add new order status as per your need.

      Add history order status Opencart

      You can see the order statuses mostly in payment gateways, sales orders, and Customer Orders Report. You can get reports as per the filtering of the order status.

      Latest order with order status

      Customers can see the order status when they check their Order history and view their order. Their order statuses are shown in the Order history section:

      Customer order status

      In this way, you can manage the Order statuses in Opencart. Please don’t forget to post your questions or comments so that we can add extra topics. You can follow us at our twitter account @rupaknpl, subscribe to our YouTube channel for opencart tutorials, and click to see all Opencart user manual.

      Stock Statuses management and product availability in Opencart 4

      In Opencart 3 we can manage the stock statuses. For that go to admin >> System >> Localization >> Stock Statuses then you can enter the Stock Status Name. In this section, you can create Out of Stock statuses to be displayed on the product page when a product is out of stock. The image below shows default stock statuses:

      Stock statuses Opencart

      Opencart has multiple stock settings at admin >> System >> Settings >> Edit the store >> and go to Option tab >> Stock section, you will see multiple settings for Stock.

      settings for out of stock in Opencart

      Display Stock: Display stock quantity on the product page.

      Show Out Of Stock Warning: Display out of stock message on the shopping cart page if a product is out of stock but stock checkout is yes. (Warning always shows if stock checkout is no)

      Stock Checkout: If selected yes it allows customers to still check out if the products they are ordering are not in stock.

      If you select the Display Stock to Yes then you can select which Stock Status name to show on the product page. Go to admin >> Catalog >> Products >> Edit/Add the product >> go to the Data tab, then go to the Out Of Stock Status field then you can choose which Stock status name to show in the frontend on the product page.

      Product stock statuses Opencart

      As in the below image, it will show the Out of Stock Status in the frontend.

      Stock statuses frontend Opencart

      In this way, you can manage the Stock statuses in Opencart. Please don’t forget to post your questions or comments so that we can add extra topics. You can follow us at our twitter account @rupaknpl, subscribe to our YouTube channel for Opencart tutorials, and click to see all Opencart user manual.