loopforever
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: How can I turn off comments on media uploads?Thank you. The same cannot be said for me.
Also, I think the purpose of the
“Developing with WordPress” forum is to provide solutions rather than suggest plugins.- This reply was modified 2 years, 5 months ago by loopforever.
Forum: Plugins
In reply to: [WooCommerce Address Book] New Input FieldI got it, I didn’t know that. Thank you. I wish you good work.
Forum: Plugins
In reply to: [WooCommerce Address Book] New Input FieldExactly:
just add 1 single field that would be tied to either the “Billing” or “Shipping” address selector?
Forum: Plugins
In reply to: [WooCommerce Address Book] New Input FieldThank you for your answer. I hope you understood me correctly. Yes, the field I added is part of the payment/checkout form.
Just like “Address”. For example, this could be: “Alternate address,Business address etc.”.I’m thinking of integrating this new input with your plugin. Therefore, this new field must also be registered in the address book.
Below is an example:
StackoverflowForum: Plugins
In reply to: [WooCommerce] How to dynamically change product category slugs?Sorry, you misunderstood me. Please re-read what I wrote.
In short, I want to update the permalinks of the product categories I have saved in the past.
Forum: Plugins
In reply to: [WooCommerce] Get discount information after orderThis is not a complex development issue. Unfortunately, you are copy-pasting canned answers. Previously, Woocommerce support was not like this.
I’m not asking you to write code. Such a function, usage etc. I’m asking whether there is or not.I also wrote what you call complex. Maybe it helps someone else. I am sharing it below.
Have a nice day./** * If there is a discounted item, save it in the woocommerce_order_itemmeta table for further use. * * @return void */ add_action( 'woocommerce_payment_complete', 'order_check_discounted_price_control' ); function order_check_discounted_price_control( $order_id ){ //create order object $order = wc_get_order($order_id); foreach ($order->get_items() as $item_id => $item ) { $product = $item->get_product(); //Check if the item is discounted if($product->get_sale_price() != $product->get_regular_price()){ wc_add_order_item_meta($item_id,'_discounted_item', $product->get_regular_price()); } }
Forum: Plugins
In reply to: [WooCommerce] Get discount information after orderThank you for your answer. I looked at the samples in the link you sent. However, I couldn’t find what I was looking for.
I hope you understand what I mean. I’m wondering if there is a function that does this. Otherwise unfortunately I’ll have to deal with it myself, work on it and write a new function.There is a product named A.
Regular Price: $100 dollars
Sale Price: $50The customer adds the product to the cart and successfully purchases the product.
This is where I start everything. I want to get regular price and sale price “on order”. So, I’m looking for questions like how much did the customer buy this product and bought it at a discount.
Yes, you can have this product-based information:foreach ($order->get_items() as $item_id => $item ) { $regular_price = $product->get_sale_price(); // The product raw sale price $sale_price = $product->get_regular_price(); // The product raw regular price }
But of course this is not true. Because, this price may change later. For example, the discounted price can be removed. That is, only regular price ($100) can be sold. Or a price of more: $110.
Forum: Plugins
In reply to: [WooCommerce] WC Rest API SlownessThere are no plugin conflicts. I will look for another way. Thank you.
Forum: Plugins
In reply to: [WooCommerce] WC Rest API SlownessThank you.
So what is the result?
Why is the REST API slow? Have you checked the report I’m seeing?Forum: Plugins
In reply to: [WooCommerce] WC Rest API SlownessThank you for your response. I will try what you said. Thank you.
The Automattic\WooCommerce\Admin\API\Options::get_options function is deprecated since version 3.1.
Also WC System Report: Here
Another PHP error is session error. It’s a problem with the code I wrote, but I couldn’t solve it. If you have an opinion and express it, I will be glad:
…Cannot start session when headers already sent in…line 4I have reviewed the file many times. There is no space before the php tag. Also the session definition is at the top of the page. However, I couldn’t solve the problem.
Image<?php if (session_status() == PHP_SESSION_NONE) { session_start( [ 'read_and_close' => true, ] ); //... }
Forum: Plugins
In reply to: [WooCommerce] WC Rest API SlownessThank you for your response. I am using Woocommerce REST API with PHP to fetch the data.
Basically the data I want to get are Product Descriptions.I’m using the following PHP wrapper to perform this action: automattic/woocommerce
Also, i am using the basic Woocommerce documentation: GitHub
GitHub-2First of all, I get the products with the following code.
$page = 1; $products = []; $all_products = [] do{ try { $products = $wc->get('products',array('per_page' => 100, 'page' => $page)); }catch(HttpClientException $e){ die("Can't get products: $e"); } $all_products = array_merge($all_products,$products); $page++; } while (count($products) > 0);
Then I get the product descriptions by doing the simple or variable control. I’m trying to get around 500 product information.
I don’t quite understand what you’re talking about as a limitation. In a global and well-known company, i am currently using a shared server.
- 1 vCPU
- 2GB Memory
- 25GB SSD
- 2TB Transfer
Also, there are no outstanding server graphics during this process. Also on the local side, memory, timeout etc. I made the necessary php settings for it. I also performed API transactions from other sites that did not use Woocommerce before. However, I have not encountered such a situation. So I don’t see a problem on the local side.
- This reply was modified 2 years, 10 months ago by loopforever.
- This reply was modified 2 years, 10 months ago by loopforever.
I understand. Thank you for your interest.
Forum: Plugins
In reply to: [WooCommerce] open basedir error in edit product pageThank you for your answer.
I want to ask something else. I don’t know if I should open an issue.
I am trying to use WC Rest API over localhost. I am pulling data from live website (For product display, update etc.)
However, this happens very slowly. Often times it expires. What can be done for the solution?Forum: Plugins
In reply to: [WooCommerce] open basedir error in edit product pageThank you for your answer.
Your request is here- This reply was modified 2 years, 10 months ago by loopforever.
Forum: Plugins
In reply to: [WooCommerce] Import ProblemThank you very much for your interest.