Last active
October 2, 2024 16:41
-
-
Save dev-prakhar/e6c15c3d16bad3361bf07e7c6bedd68c to your computer and use it in GitHub Desktop.
FoxSell Bundles Plus - Metafields and Metaobjects Access (Liquid)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| assign app_namespace = 'app--67872686081' | |
| assign cross_sell_bundle_config = product.metafields[app_namespace].cross_sell_products.value | |
| assign active = cross_sell_bundle_config.active | |
| %} | |
| <p> | |
| <strong>Active: </strong> | |
| {{ active }} | |
| </p> | |
| <p><strong>Widget Settings:</strong></p> | |
| <p>{{ cross_sell_bundle_config.widget_settings.value | json }}</p> | |
| <p><strong>Discount:</strong></p> | |
| <p>{{ cross_sell_bundle_config.discount.value | json }}</p> | |
| <p><strong>Products:</strong></p> | |
| {% for bundled_product in cross_sell_bundle_config.bundled_products.value %} | |
| {% liquid | |
| assign product_gid = product.id | prepend: 'gid://shopify/Product/' | |
| assign bundled_product_properties = cross_sell_bundle_config.product_properties.value[product_gid] | |
| %} | |
| <p><strong>Product Title: </strong>{{ bundled_product.title }}</p> | |
| <p><strong>Product Properties: </strong></p> | |
| <p><strong>Bundle ID: </strong>{{ bundled_product_properties.bundle_id }}</p> | |
| <p><strong>Quantity: </strong>{{ bundled_product_properties.quantity }}</p> | |
| <p><strong>Available Variant Ids: </strong>{{ bundled_product_properties.variant_ids }}</p> | |
| {% endfor %} | |
| {% schema %} | |
| { | |
| "name": "FoxSell CSW Snippet", | |
| "tag": "section", | |
| "blocks": [], | |
| "settings": [ | |
| ], | |
| "presets": [ | |
| { | |
| "name": "FoxSell CSW Snippet" | |
| } | |
| ] | |
| } | |
| {% endschema %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| assign app_namespace = 'app--67872686081' | |
| assign dynamic_bundle_config = product.metafields[app_namespace].dynamic_bundle.value | |
| assign bundle_id = dynamic_bundle_config.bundle_id | |
| assign categories = dynamic_bundle_config.categories.value | |
| assign widget_settings = dynamic_bundle_config.widget_settings.value | |
| assign options = dynamic_bundle_config.options.value | |
| assign discount = dynamic_bundle_config.discount.value | |
| assign is_fixed_pricing = false | |
| if widget_settings.pricing_strategy == 'fixed_pricing' | |
| assign is_fixed_pricing = true | |
| endif | |
| assign is_quantity_as_option = false | |
| if options.size > 0 | |
| assign is_quantity_as_option = true | |
| endif | |
| %} | |
| <p><strong>Bundle ID</strong>: {{ bundle_id }}</p> | |
| <p><strong>Widget Settings:</strong></p> | |
| <p>{{ widget_settings | json }}</p> | |
| <p><strong>Options:</strong></p> | |
| <p>{{ options | json }}</p> | |
| <p><strong>Discount:</strong></p> | |
| <p>{{ discount | json }}</p> | |
| <p><strong>Category</strong></p> | |
| {% for category in categories %} | |
| <div> | |
| <p><strong>Title:</strong> {{ category.title }}</p> | |
| <p><strong>Quantity:</strong> {{ category.quantity }}</p> | |
| <p><strong>Products</strong></p> | |
| {% for p in category.products.value %} | |
| {% assign product_gid = 'gid://shopify/Product/' | append: p.id %} | |
| <p> | |
| <strong>Title: {{ p.title }}</strong> | |
| </p> | |
| <p><strong>Properties:</strong></p> | |
| <p>{{ category.product_properties.value[product_gid] | json }}</p> | |
| {% endfor %} | |
| </div> | |
| {% endfor %} | |
| {% schema %} | |
| { | |
| "name": "FoxSell M&M Test", | |
| "settings": [], | |
| "presets": [ | |
| { | |
| "name": "FoxSell M&M Test" | |
| } | |
| ] | |
| } | |
| {% endschema %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| assign app_namespace = 'app--67872686081' | |
| assign dynamic_add_ons_bundle_config = product.metafields[app_namespace].dynamic_add_ons_bundle.value | |
| assign bundle_id = dynamic_add_ons_bundle_config.bundle_id | |
| assign options = dynamic_add_ons_bundle_config.options.value | |
| assign products = dynamic_add_ons_bundle_config.products.value | |
| assign add_on_products = dynamic_add_ons_bundle_config.add_on_products.value | |
| assign add_on_product_properties = dynamic_add_ons_bundle_config.add_on_product_properties.value | |
| assign categories = dynamic_add_ons_bundle_config.categories.value | |
| %} | |
| <p><strong>Bundle ID</strong>: {{ bundle_id }}</p> | |
| <p><strong>Options:</strong></p> | |
| {% for option in options %} | |
| {% for pair in option %} | |
| {% liquid | |
| assign key = pair[0] | |
| assign value = pair[1] | |
| %} | |
| <p><strong>Variant ID:</strong> {{ key }}</p> | |
| <p>{{ value | json }}</p> | |
| {% endfor %} | |
| {% endfor %} | |
| <p><strong>Categories</strong></p> | |
| {% for category in categories %} | |
| <p><strong>Title:</strong> {{ category.title }}</p> | |
| <p><strong>Category Max Quantity (Only used if Options are Empty):</strong> {{ category.quantity }}</p> | |
| <p><strong>Products</strong></p> | |
| {% for p in category.products %} | |
| {% liquid | |
| assign int_product_id = p.id | times: 1 | |
| assign product_ref = products | where: 'id', int_product_id | first | |
| %} | |
| <p><strong>Product ID:</strong> {{ p.id }}</p> | |
| <p><strong>Product Title:</strong> {{ product_ref.title }}</p> | |
| {% for variant in p.variants %} | |
| {% liquid | |
| assign key = variant[0] | |
| assign value = variant[1] | |
| %} | |
| <p><strong>Variant ID:</strong> {{ key }}</p> | |
| <p><strong>Variant Overridden Price:</strong> {{ value }}</p> | |
| {% endfor %} | |
| {% endfor %} | |
| {% endfor %} | |
| <p><strong> Add On Products</strong></p> | |
| {% for p in add_on_products %} | |
| {% assign product_gid = 'gid://shopify/Product/' | append: p.id %} | |
| <p><strong>Title:</strong> {{ p.title }}</p> | |
| <p><strong>Properties:</strong> (Format: {variant_id: price})</p> | |
| <p>{{ add_on_product_properties[product_gid] | json }}</p> | |
| {% endfor %} | |
| {% schema %} | |
| { | |
| "name": "FoxSell M&M Add Ons Test", | |
| "settings": [], | |
| "presets": [ | |
| { | |
| "name": "FoxSell M&M Add Ons Test" | |
| } | |
| ] | |
| } | |
| {% endschema %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| assign namespace = 'foxbundle' | |
| assign volume_bundle_config = product.metafields[namespace].volume_bundle_settings.value | |
| assign bundle_id = volume_bundle_config.id | |
| assign active = volume_bundle_config.active | |
| assign widget_settings = volume_bundle_config.widget_settings | |
| assign discounts = volume_bundle_config.discounts | |
| %} | |
| <p><strong>Bundle ID: </strong>{{ bundle_id }}</p> | |
| <p><strong>Available Variant Ids: </strong>{{ volume_bundle_config.variants }}</p> | |
| <p> | |
| <strong>Active: </strong> | |
| {{ active }} | |
| </p> | |
| <p><strong>Widget Settings:</strong></p> | |
| <p>{{ widget_settings | json }}</p> | |
| <p><strong>Discounts:</strong></p> | |
| {% for discount in discounts %} | |
| <p><strong>Title: </strong>{{ discount.title }}</p> | |
| <p><strong>Quantity: </strong>{{ discount.quantity }}</p> | |
| <p><strong>Percentage: </strong>{{ discount.value }}%</p> | |
| {% endfor %} | |
| {% schema %} | |
| { | |
| "name": "FoxSell VB Snippet", | |
| "tag": "section", | |
| "blocks": [], | |
| "settings": [ | |
| ], | |
| "presets": [ | |
| { | |
| "name": "FoxSell VB Snippet" | |
| } | |
| ] | |
| } | |
| {% endschema %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment