Questions tagged [order]
The order tag has no usage guidance.
78
questions
0
votes
0
answers
27
views
Is there any events to trigger for inserting data into orderAdjustment table
I'm implementing a module to integrate a third party gift voucher into the craft cms application. For that I need to trigger the order Adjuster every time the cart gets updated.
TIA
1
vote
2
answers
42
views
Return all orders from a list of countries in Commerce v3
A little stuck on trying to get the query right for this, I have a module where I need to write a function that returns all orders placed with billing addresses in a selected list of countries. The ...
1
vote
3
answers
33
views
How can I order Site Groups?
I have this query that lists out the site groups:
craft.app.sites.getAllGroups()
How can I order the result? Ideally I'd like to add a custom field to the Site Groups entry, but it doesn't seem Craft ...
0
votes
0
answers
67
views
How to order entries by two fields, one being a date, the other being a time?
I would like to order my entries first by date, and then by time. So if several entries are on the same date, they will be ordered by time within that day.
This is my query:
{% set query = {
...
1
vote
1
answer
116
views
How to persist modified order of cart line items?
I wrote a function to sort / re-order the line items in a cart.
function sortCart(Order $order) {
$lineItems = $order->getLineItems();
$lineItemsOrdered = array();
// [...]
$order-...
0
votes
1
answer
83
views
Get random entries order at each page load, but avoid repetitions
The easiest way to get a entries sort by random is to apply this: .orderBy('RAND()').
This is very useful, however I have a case where I need to get entries (which are adverts) in a random sequence ...
1
vote
1
answer
49
views
Reordering Matrix blocks by date in the control panel when saving an entry
I'm trying to reorder Matrix Blocks in date order when saving an entry in the control panel. I kind of have it working using the following code.
My Matrix field is 'events'. Each block contains a date ...
1
vote
1
answer
85
views
Craft Commerce: Replacing Adjuster causes error "Something changed with the order before payment, please review your order and submit payment again."
In a current project we need more complex logic to determine when to set the VAT to 0%, so we do this with an adjuster added through a module.
We are using the exact method described on https://...
0
votes
0
answers
107
views
Order Condition Formula in a Shipping Condition
I have digital products that are sold alongside physical products and need a way to set it so that the 'standard shipping' method is not shown as an option if ONLY digital products are in the cart/...
1
vote
2
answers
102
views
OrderBy section when selecting multiple sections in entries query
When getting pages from multiple sections like so:
{% set aboutNavigation = craft.entries
.section(['about', 'newsIndex'])
.all() %}
How can I set order that the sections appear?
So I want ...
2
votes
2
answers
100
views
sort by checkbox field with multiple options and by postDate desc
Section handle: players
field handle: teamName
The checkbox field has two options:
Cubs
Tigers
Not all players will have the teamName field checked.
I want to order players who are Cubs or Tigers ...
1
vote
1
answer
201
views
Commerce email receipt not sent after order, but manual Send Email in Order screen works
I have placed a successful order in Commerce and it's settings have an email setup to send an email to the customer and use the example special/receipt email.
But the receipt email is not sent once ...
1
vote
1
answer
277
views
Commerce new order error : mail::getRenderLanguage() must be of the type string
I just pushed an update to the latest version of craft cms and craft commerce and ran into an error that is blocking new orders from finalizing.
Everything works on the local site. On the live site, ...
1
vote
2
answers
127
views
Change order content blocks home page
Good afternoon, I was wondering to what extent you can change (the order for example) the existing contentblocks on the pages. Thank you in advance!
1
vote
1
answer
63
views
Craft Commerce: Filter completed orders based on a product category field
I know how to filter entries or products based on a category field with .relatedTo, but how can I filter completed orders based on a product category field?
In this specific case, I have an overview ...
1
vote
2
answers
438
views
Craft Commerce: ordering products like a structure
Is it possible to change the order of products in Craft Commerce (3) by drag & drop? Just like it is done with the entries of a structure?
If not, how am I supposed to change the order of products?...
1
vote
1
answer
97
views
How to update the lineItemStatus of an order on the front end with twig?
I'm building a simplified interface that is only going to be used by employees preparing the orders. They are in a usergroup that has the right permissions to update orders.
I'm building this because ...
1
vote
1
answer
58
views
LineItems not showing in CMS
I'm scratching my head. My orders are shown perfectly except for one product. I have no idea why so I looked at the Order object before saving and I can't seem to figure out why he won't show the ...
0
votes
1
answer
483
views
Stock Levels for Commerce 2
I am putting together a proposal for an eCommerce site - one of the (obvious) requirements is inventory management. I do not see anything specific in the Commerce 2 docs. Basically, want to enter ...
1
vote
1
answer
69
views
Order grouped results by dropdown order
Following this topic, I have an additional question.
The results are not ordered by the order of the Dropdown Options.
How can I get this done?
Code:
{% set players = entry.myPlayersMatrix %}
{% ...
2
votes
1
answer
180
views
Commerce 1: Different default order status based on product types
I want to assign different default order status based on product types. Is this possible?
What I need to achieve is to send different email notifications based on product types. Can this be ...
5
votes
1
answer
1k
views
How to order or filter entries by their author's custom field?
Is it possible to order and/or filter all entries from a section whose author has a custom field value that is set to "X"?
Below is the starting code.
in Twig:
{% set elementQuery = craft.entries()...
0
votes
1
answer
138
views
Order entries by content of their fields
Can I order entries by the content of a field every entry has?
{% for entry in craft.entries.section('entries').order( *first time field of a matrix block within the entry* ).all() %}
1
vote
1
answer
93
views
Show entries in the Control Panel as a grid, to reorder position
I am looking for a way to display entries in a (5er) grid
in the Craft backend (Control Panel) and show only the featured images.
I have a customer who has on her website a gallery, where 5 squares ...
1
vote
1
answer
1k
views
How to reorder structure entries in the Admin panel?
I converted a channel into a structure and now my entries are listed in reverse order.
I have a very large number of entries. Is there a way or a plugin to permanently sort them and store the order?
1
vote
1
answer
196
views
Commerce 1 create a new order programmatically
How can this be done in PHP? I can't find anything in the docs.
1
vote
2
answers
563
views
Can I set a Commerce order custom field from a plugin
On a site with Commerce 1, I have set up some custom fields for order related data. I can set them using form inputs like so:
<input type="hidden" name="fields[myCustomField]" value="1">
I'd ...
1
vote
1
answer
284
views
How to create ordered list of categories from multiple category groups
I have got multiple category groups and I need to concatenate them into one list for a filter UI element.
At the moment I have the following:
{% set categories = craft.categories.group('colour').all(...
2
votes
1
answer
291
views
Order products by lowest product variant
Currently using Craft Commerce 2.
I was wondering if it's possible to order products by the lowest priced variant. I have tried something along the lines of this, but it doesn't do anything ...
1
vote
1
answer
64
views
Special order filter (by language) in CP for Craft Commerce
We have a online-shop for german customers (Craft 2 + Commerce 1) and will expand the shop for american customers (via second domain).
Is there a way to filter the order (status) views in the Backend ...
1
vote
0
answers
332
views
Getting the order for categories.lft rgt
While trying to assign a global CSS class based on the order of the categories based on the drag and drop in the admin editor.
The categories I'm using is a single 1 level deep category.
It seems ...
1
vote
0
answers
62
views
Commerce: reading Stripe object in Craft Transaction model
I'm looking to add the credit card last four digits to my customer's frontend order history. Stripe is the gateway. The Stripe transaction object doesn't seem to be available in the Craft ...
1
vote
1
answer
322
views
How to save Order Status Message in Craft Commerce using frontend form
It's easy enough update the order status from the frontend using:
<input type="hidden" name="action" value="commerce/orders/updateStatus">
<input type="hidden" name="orderId" value="{{ order....
1
vote
2
answers
237
views
Partial Order Fulfillment
Is it possible to fulfil orders partially? For instance when only two of four products are in stock, would it be possible to ship the two items immediately?
1
vote
1
answer
789
views
Placing a Test Order (Craft Commerce)
This is a really basic question but I have had trouble finding an answer, or documentation on it.
What is the best way to place a test order with a default Craft Commerce installation? I'm unable to ...
2
votes
3
answers
108
views
Show time ordered entries from midnight at end of loop
I'm creating a line up listing page for a festival, across 4 nights. Acts are listed, per day, sorted by a date field in order of a start time field.
The issue I'm having is that midnight until 3am ...
1
vote
1
answer
43
views
what does {% set order = 'pin desc, postDate desc' %} do?
I am new to using twig and I do not understand how this line of code works. If you could explain that would be wonderful! thanks:)
1
vote
1
answer
60
views
Product category not being added to the order model. Craft Commerce
I've created a form in which to specify a category for a product on the product entry page. I can't seem to add the category that the customer selects to the order model. I've checked the orders in ...
1
vote
1
answer
411
views
Missing Download PDF Button in Orders for Craft Commerce
I'm not sure what happened, but the "Download PDF" button that is on the orders in the CMS is missing. I thought maybe the order PDF template file or path was missing but both of those are there. Is ...
3
votes
3
answers
1k
views
Option and notes fields after cart at checkout for order, not just line items
My client has gift wrapping services but they apply to the entire order, not one single line item.
How would I add notes or custom fields to the entire order, at the shipping stage of checkout? is ...
2
votes
1
answer
230
views
Creating a sitemap/index page, ordered by A-Z and 0-9
I'm created an Index like page (like at the back of a book) for entries within a certain section, ordered alphabetically with the letter proceeding it.
My code below seems like a tedious way to do it,...
3
votes
1
answer
259
views
Set Entries field in Commerce order on completion
I'm trying to set an Entries field within a Commerce Order once the order completes.
I've tried using the onOrderComplete event like so;
craft()->on('commerce_orders.onOrderComplete',function($...
2
votes
2
answers
407
views
Craft Commerce: Sort products by Sale price
Trying to sort products by price.
{% set products = craft.commerce.products({
type: 'footwear',
limit: shopSettings.productsPerPage,
order: 'defaultPrice asc',
}) %}
It works fine.
Please ...
1
vote
1
answer
441
views
Sort entry titles alphabetically excluding 'The'?
I need to list the names of all of my entries in alphabetical order excluding 'the' (which could only be at the beginning). I've looked around online, but I was only able to find a code segment (which ...
1
vote
2
answers
1k
views
Craft Commerce - Edit Complete Order Address from frontend
We are trying to give our clients the ability to update an order's shipping address before the order has been actually shipped.
We've created a members area where they can list their orders and ...
1
vote
1
answer
410
views
Sort products by category field value
All of my products have a category field called stateCat. These state categories have a field called stateImportance. This is because some states are more important than others and I want to sort the ...
2
votes
2
answers
1k
views
Sort entries by custom date in Matrix field / Super Table
I currently have numerous Super Tables with date fields inside and I am trying to get all table items to list themselves together in date order depending on what the user inputs. I have tried using ...
1
vote
1
answer
492
views
Craft Commerce - Create Order from Control Panel
We've been looking around to get some info for this feature but didn't find anything yet and wanted to ask here in case we are missing something.
Is there a way to create an order from the Control ...
1
vote
2
answers
2k
views
ElementAPI: How to order and/or limit results?
Currently collaborating on a site with another developer, which is using ElementAPI pretty heavily for content delivery.
Is there a way to limit the number of returns on any given json feed? Say; ...
1
vote
1
answer
251
views
Search entries ordered by sections
Is it possible to perform a search and have the results grouped/prioritized by sections?
e.g. something like:
craft.entries.section(['sec3', 'sec5', 'sec1']).search(...).limit(6) as page_info, ...