1. Home
  2. Docs
  3. Doc of Product XML Feeds ...
  4. ShortCode
  5. Shortcodes Guide Product XML Feeds for WooCommerce

Shortcodes Guide Product XML Feeds for WooCommerce

AD 4nXc4ueZhyaYXi6IEif51iIpmY7peIPCX7r0f QbqGQFIpKQRzTLPNBUYx53nOihGJQELT4wJKShtq6Y3YMCigKlRCsV3pijBmOIw8Q7KmPUCaMSZBqgZfdBthiN3TnQ8B6tmu39fOygAu202VATkDOJ 2TQc?key=R6KjyIA78Xd4vEe9HLMDJA

The “Product XML Feeds for WooCommerce plugin” unlocks a powerful way to share your product data across various platforms. But to truly leverage its potential, you need to understand the shortcodes it provides.

Shortcodes for Core Product Information

  1. [alg_product_name]
    • Description: Displays the name of the product.
    • Parameters:
      • strip_tags (optional): Set to yes to remove any HTML tags.
    • Example Usage: [alg_product_name strip_tags="yes"]
    • Use Case: Use this shortcode to include the product name in your XML feed, with the option to strip out HTML tags for cleaner data.
  2. [alg_product_description]
    • Description: Outputs the product description.
    • Parameters:
      • strip_tags: Remove HTML tags (defaults to no).
      • on_empty: What to display if the description is empty.
    • Example Usage: [alg_product_description strip_tags="yes" on_empty="Description not available."]
    • Use Case: Include a product description in your XML feed, with options to clean up the content and provide a fallback message if the description is missing.

Shortcodes for Dynamic Pricing and Stock Management

  1. [alg_product_price]
    • Description: Shows the product price, with options to include or exclude tax.
    • Parameters:
      • variable_price_type: Define whether to show the range, minimum, or maximum price for variable products.
      • decimal_padding: Add padding to decimals.
    • Example Usage: [alg_product_price variable_price_type="min" decimal_padding="2"]
    • Use Case: Display the minimum price of variable products in your XML feed, formatted with two decimal places.
  2. [alg_product_categories_ids]
    • Description: Retrieves the IDs of the product categories the product belongs to.
    • Example Usage: [alg_product_categories_ids]
    • Use Case: Use this shortcode to include product category IDs in your XML feed, which can be useful for organizing products on marketplaces.
  3. [alg_product_stock_availability]
    • Description: Displays whether the product is in stock.
    • Parameters:
      • in_stock_value: Custom text to display when the product is in stock.
      • out_of_stock_value: Custom text to display when the product is out of stock.
    • Example Usage: [alg_product_stock_availability in_stock_value="Available" out_of_stock_value="Out of stock"]
    • Use Case: Inform marketplaces of a product’s availability status by including this information in your XML feed.
  4. [alg_product_publish_date]
    • Description: Displays the publish date of the product.
    • Parameters:
      • format: Defines the date format following PHP date standards.
    • Example Usage: [alg_product_publish_date format="Y-m-d"]
    • Use Case: Include the publish date in your XML feed, formatted as required by the receiving marketplace.

Shortcodes for Advanced Customization

Pro Version Shortcodes

  1. [alg_product_available_variations]
    • Description: Lists the available variations of a variable product.
    • Parameters:
      • sep: Separator between variations.
      • sep2: Separator between attributes.
    • Example Usage: [alg_product_available_variations sep=", " sep2=" | "]
    • Use Case: Display all variations of a product in your XML feed, separated by custom delimiters for clarity.
  2. [alg_product_custom_value]
    • Description: Allows for the inclusion of custom values in the XML feed.
    • Parameters:
      • value: The custom value to display.
    • Example Usage: [alg_product_custom_value value="Custom Text"]
    • Use Case: Add custom values or notes to your XML feed that may be required by specific marketplaces.
  3. [alg_format_number]
    • Description: Formats a number according to the specified format.
    • Parameters:
      • number: The number to format.
      • decimals: Number of decimal points.
    • Example Usage: [alg_format_number number="1000.5" decimals="2"]
    • Use Case: Format prices, weights, or other numerical data in your XML feed to match the requirements of different marketplaces.
  4. [alg_to_timestamp]
    • Description: Converts a date to a timestamp.
    • Parameters:
      • date: The date to convert.
      • format: The format of the input date.
    • Example Usage: [alg_to_timestamp date="2024-08-01" format="Y-m-d"]
    • Use Case: Provide timestamps instead of date strings in your XML feed, depending on the requirements of the target marketplace.
  5. [alg_product_terms]
    • Description: Displays terms associated with a product (e.g., categories, tags).
    • Parameters:
      • taxonomy: The taxonomy to retrieve terms from (e.g., product_cat for categories).
      • orderby: Order terms by specific criteria, such as name or term_id.
    • Example Usage: [alg_product_terms taxonomy="product_cat" orderby="name"]
    • Use Case: Include organized lists of categories or tags in your XML feed to better categorize products on external platforms.

These shortcodes provide a set of tools for creating detailed, customized XML feeds for your WooCommerce products. By leveraging these shortcodes, you can ensure that your product data is presented accurately and effectively across various marketplaces, helping to improve visibility and sales. The Pro version of the plugin extends these capabilities further, offering advanced options for those who require more granular control over their XML feeds.

 

Product XML Feeds for WooCommerce

Tags