Hot answers tagged

2

Stumbled upon this looking to answer similar problem. You should be able to do this now without a plugin, using the multisort filter where you iterate through your profiles, e.g.: {% for profile in profiles|multisort(['profileLastname'],[SORT_ASC],[SORT_REGULAR]) %}


2

I think I figured out the problem. This was my first time switching to the project.yaml configuration Deleting and rebuilding the project config allowed me to change the Commerce > System Settings > Email > Language which fixed the error.


2

You can use the same technique to set the line item data like this: {% set order = craft.orders.id(123).one() %} {% for lineItem in order.lineItems %} {% do lineItem.setAttributes({lineItemStatusId: 2}, false) %} {% endfor %} {% do order.setAttributes({ orderStatusId: 4, lineItems: order.lineItems }, false) %} {% do craft.app.getElements()....


2

The equivalent SQL would be something like SELECT * FROM players ORDER BY teamName IS NOT NULL DESC, postDate DESC; but I'm not sure how that would translate in a simple element query. It'd be something like: {% set players = craft.entries.section('players').orderBy('teamName IS NOT NULL DESC, postDate desc').all() %}


1

I believe this won't work the way you want it with a single query, especially with reliable performance. The problem is that you actually want 2 different sort criteria being combined. I would recommend you add an additional field just for sorting using this plugin: https://plugins.craftcms.com/preparse-field It allows you to use TWIG to prepare a value ...


1

Simple step missing on the setup of this. I needed to actually assign this email to the status New, to send when a New order is placed, in the Order Statuses section, as per this documentation. So simply a case of RTFM: https://craftcms.com/docs/commerce/3.x/order-status-emails.html#selecting-an-email


1

Fixed it! The problem was that somehow, with that product, there was an issue with setting the status of the order to 'Paid'. Once I got that working, I saw the lineitems in my order.


1

As you can see from the screenshot below and as Oli already mentioned, you can simply drag the content blocks on a page and hit the save button. That said, this is possible with contentblocks that are in a matrixfield. If you have regular fields for your page, you will need to arrange them in the section setup. Only matrix block elements can be arranged ...


1

By default, Matrix blocks will display in the order you have entered them in your entry form. If you need to change the display order, you can drag/drop your blocks straight from your entry form using the small handle on the right of the blocks and the order will be reflected on your page.


1

Managed to solve this. First, I've added a categories field to the order form. On the checkout page I loop over all lineItems in the cart and collect the category id's like this. {% set categoryIds = [] %} {% for item in cart.lineItems %} {% set categories = item.purchasable.product.productGroup.leaves().all()%} {% for category in categories %} {% ...


1

Yeh there's few workarounds. Your entries field is close to what Nathanial from P&T mentioned on the issue tracker: If you create a global set and add a custom product field. Then select all the products. This gives you the ability to drag and drop the order of the products. You can use this in conjunction with the on save event and catch the save of ...


Only top voted, non community-wiki answers of a minimum length are eligible