Articles on: FAQ

How to add Cart item property for deposits based on selling plan title?

Go to the theme code editor.

In the Templates section, locate the cart.json file.



Within the file, find the section with type: main-cart-items. Note that the type may vary across different themes, but it will be similar in general.



In the Sections section, among the files, find the one with the same name as the type from the previous step.

In the file, identify the place where line item properties are displayed. Typically, it starts with {%- for property in item.properties -%} and ends with {%- endfor -%}, followed by either </ul> or </dl>. Depending on your preference, add the line <span>{{ item.selling_plan_allocation.selling_plan.name }}</span> either above or below this section.



Save the changes and check how the subscription is displayed on the cart page. If anything seems off, you can try placing the line from the previous step further down or up in the code.

This instruction is suitable for OS 2 themes. For other themes, there won’t be steps 2 and 3, and the section name from step 4 needs to be identified. Typically, it could be cart-template, cart-section and so on. If you don't find the code from step 5 where you can place the selling plan name in sections with such names, you can navigate to the Snippets section and look for the relevant piece of code in a file named cart-item or something similar.

Updated on: 13/08/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!