Strange product quantity behavior in OpenCart 2.0 - opencart

I'm evaluating OpenCart and it seems to be a competent tool to use as a e-store. However, I have a problem regarding the quantity of the products. Just to make sure I haven't done anything wrong, I just made a clean install.
Here's what I've tested:
I installed OpenCart 2.0.0.0 and changed the following:
Order Status: Processing
Processing Order Status: Processing
Complete Order Status: Complete
Then I changed some settings for a default product (iPhone).
Quantity for the product is set to 30. (Subtract stock: Yes)
I added two options as checkboxes ("Checkbox 1" and "Checkbox 2") which have the quantity of 15 each. (Subtract stock: Yes)
I then added an iPhone to the cart (checking "Checkbox 1") and checked out with the "Cash On Delivery" option.
Now, the order was placed and the status is Pending. The quantity was not changed yet.
I added a order history with status Processing which decreased the quantity both the product and the option ("Checkbox 1").
All is fine until now. Now I'm adding the order history with status Processed. This resets the quantity. Yesterday when I did somewhat the same, the quantity was decreases once for every order history I added.
Am I doing something wrong here? I really need the quantity to work.
Bonus questions:
Is there a way to change the options' names (from "Checkbox 1" to "White" and "Checkbox 2" to "Black" for example)?
How do I change so that the status becomes "Processing" when a customer checks out?

In admin>system>settings edit your store and go to the "Option" tab.
Under "Checkout" you have:
"Processing Order Status" and "Complete Order Status".
These two let you choose, respectively, at which status the stock should be subtracted and at which status the order should be considered as complete.
In your case if you want the status of a completed order to be "Processed" then you have to change the "Complete Order Status" to "Processed".
For the other two questions:
1) To change the checkbox names go to Catalog>Options in your admin dashboard. There you can either edit an already existing option or create a new one.
2) Each checkout option can have different processing statuses. These can be changed accordingly in their respective settings in the Admin>Extentions>Payments.

Related

How to insert and update the inserted row in Oracle APEX?

I want my "Create" button to insert a row on a table and once inserted to update that row. The reason I need to insert that row first and then update is because some columns that I want to update depend on the value being there in the first place. For example I would like to update the "Gross Margin" column but the "Gross Margin" = Payrate + something else. If I don't have the value in "Payrate" column, well there is no way I can update "Gross Margin" since it depends on it.
What I have tried:
) Create a Dynamic Action that triggers if "create" button is clicked. If its clicked is true then run the 2 true actions of type "Execute server side code" which is the Insert statement and the other is the Update statement. I made sure that Insert has the first sequence(It runs first) then the update(It runs second). Please see below picture of the settings of the "Create" button.
Please see below picture of the settings of the "Dynamic action"
See below settings of the "Insert Action"
Below settings of the "Update Action"
2.) I have also tried by creating a "Process" that is binded to the "Create" button when clicked but it did not worked.
I am open to all suggestions and thank you in advance!
I created a workspace on apex.oracle.com to illustrate my answer:
workspace: SO_HELP, username: so_68399404, pwd: so_68399404
App 22384 (Demonstration - EMP / DEPT) is an app generated on the standard emp/dept sample dataset. In the report "Employees", there is a "create" button but employees can also be edited with the edit icon. Both the "create" button and the "edit" link point to the same form (page 4). The salary is depends on the job. If the job is MANAGER then salary is set to 5000 else salary is increased by 1. Similar to your requirement. I did this with an after submit computation with code
CASE WHEN :P4_JOB = 'MANAGER' THEN 5000 ELSE :P4_SAL + 1 END
No other code needed. No dynamic actions, no custom processes. All updates are handled by the process of type "Automatic Row Processing - DML". Login with the credentials above and have a look. If it is not what you need, please explain exactly what is different in this app - or create a new form/report on that data to illustrate your issue.
May I suggest you ask your questions this way ? Extract your problem out of your code and illustrate it with the sample dataset. No one knows your actual data, everyone knows the emp/dept schema. That can avoid endless discussions in the comments.

OpenCart - Create unique product option from within product edit page

Would it be possible (with some modification or maybe an existing plugin) to create unique product options from within the product edit page? Those options then only assigned to that product?
In total across all my products, I'll have around 500 'options'. Each product of mine has about 5 options, rather than having to go to the OPTIONS section which will then list all 500, I'd rather input them directly from within the product edit page.
As it stands I cannot, I have to create the 'option value' elsewhere, then go back in to the product edit page area and then assign the option.
As you'll see in my attachment, you can only select already created product 'options value' from the product edit page, not create them here.

Opencart, Flat Charge for option (not related to Quantity)

I am having trouble with my order processing for Opencart 1.5.6. I have a series of checkboxes that if checked each cost $50.00. The problem is that the customer is ordering print materials in quantities of 500, 1000, 5000, etc. When they get to the shopping cart it charges the $50 extra for each option for each individual item ordered based on the quantity. This makes it so that their total skyrockets. If they pick one option for $50 and order 500 business cards they get charged an extra $25,000 for that one option.
The only solution that I can see is to have the Quantity be an option and only allow them to order one product but that does not allow them to change the Quantity of cards in the Cart.
Is there anyway to set it up so that an option charges a flat rate not based on total quantity of the order?
When customizing OpenCart follow these steps.
Look to see if this link has an extension that will do what you want.
If step 1 did not work. Go to your public_html file (the place that has all your code). Open the files that are related to your problem and edit those. There is also an OpenCart forum that will help with common problems.
As far as changing the settings on your payment function. Go look at OpenCart->catalog->checkout folder. Or maybe OpenCart->admin->checkout. You will need to find the function that adds quantity and gives value. You will need to change those around a little.

variable date option in opencart

1st I want to remove text field for date so the calendar will replace it.
2nd I want to make the status order.. I want to sell the service, so I need to make booking order by calendar. If the date is green client can make an order. If red the client can't book an order. If yellow there certain items can be ordered.
I hope someone can help..
Thanks.
You have to try something at least and ask only for advice then.
Anyway, few suggestions:
it cannot be done using that option field of type date, at least not with the default datepicker.
You will need to create Your own datepicker component that will search for free/partialy/fully ordered days in the database and color the table cells accordingly.
It is not very wise to hide the input - by this visible user could anytime check what date did he pick - if it is not visible he would need to always open the datepicker to check for it...
Disallowing to order some service based on some reservations is highly decreasing Your conversion rate - thus decreasing Your income. I would definitely go the way let the user buy/order anything at anytime while having separate reservation system. If user buys a service at thank You page I would recommend him to book a concrete date for the service to be drawn. Here You do not need to fight with product options which are meant totally for something different that You are trying to.
Keep that in mind (mainly the 4th point) and re-think Your problem.

How to handle expired items?

My site allows users to post things on the site with an expiry date. Once the item has expired, it will no longer be displayed in the listings. Posts can also be closed, canceled, or completed. I think it would be be nicest just to be able to check for one attribute or status ("is active") rather than having to check for [is not expired, is not completed, is not closed, is not canceled]. Handling the rest of those is easy because I can just have one "status" field which is essentially an enum, but AFAIK, it's impossible to set the status to "expired" as soon as that time occurs. How do people typically handle this?
Edit: I'm not asking how to write a query to find expired items; I'm asking how I can find the "active" (unexpired items that meet a few other boolean conditions) without having to use a big nasty query every time I want to find them.
I think that can be managed with cronjob and django custom management command, is just an idea.
Make the item have birth and death (type:date) columns and a status column (completed, removed, to be expired...).
Update/fill the death column when you want to logically end the lifecycle of an item (for whatever reason: expiry, completed, ...). Update the status column accordingly.
Querying for active items (in pseudo-SQL):
select * from mytable where birth <= todays_date <= death or death is null
It sounds like the expiration date/time is the field that you need to actually store and make decisions based off of. IsActive sounds like something you would calculate on the fly based on the expiration date and possibly other fields (even though its a pain)
IsActive as a field would probably work better if it wasn't a product of some other information like the expiration date, but was valid on its own, such as if a user manually set the status to "active" or "not active".