I have a module for Opencart 3 – Category Bestseller. It shows the popular categories in which the most items are sold. I would like to change this filter. Make it so that it shows the categories in which the most viewed products. After sorting through the files, I found that this was written in the mod…
BankID and CURL ERROR 77 or CURL ERROR 60
I’ve spent a few hours trying to get cURL (in PHP) to work with the Swedish BankID service, and running into the following two certificate errors: The code I’m using to initialize cURL is the following: I’ve tried various variations of the CURLOPT_CAINFO and CURLOPT_CAPATH options, but I sti…
WooCommerce Filter products with ACF and Product Category
I am using WooCommerce to display a product loop and have built out a filter for the same loop. The filter uses acf meta which the values are pulled directly from the query string. The meta_query is working as expected, however the tax_query seems to be not ineffective. I need some assistance as to why my tax…
Check if data updated_at 24 hours ago OR a day ago (laravel)
I am able to get days ago for each row in dattable using carbon. (view CustomController.php) But before the user is able to edit the data. I want to check if the data is updated a day ago or 24 hours ago. if 24 hours or a day passed user can’t update the data if it is within 24 hours
Eloquent – Update eloquent relations with foreach loop
I have a controller function to send multiple devices for repair (essentially an update request against multiple existing devices_repairs records). When I try to retrieve the devices from the devices table alongside the repair details (Devices table, devices_repairs table), the records are retrieved but when …
Trouble with || operator
I have a page (titled PPC) and a custom post type (titled Presentations) that I don’t want certain elements to appear on. I thought this code would work : Using each conditional by itself, without the ||, works fine. But when I combine them both and use the logical operator, nothing works. I’ve al…
run php file with script tag
Is there any way to insert php code through <script>? Like `<script src=”example.php”>. I know that script is only for JS but I want PHP to generate JS that I can insert with script tag. Here I found a possible sollution: Generate JavaScript file with PHP when requested in HTML. PHP fi…
Regex to match a result that isn’t single line and expanded across multiple lines
I want to change /<?phps([sS]*?)?>/gi the way that single line PHP tags become excluded. For example, here I want to match only second PHP tag and not the first one: Answer You can use A variation with multiline .: See the regex demo. Details: <?php – a <?php substring (?!S) – a right-…
Is there a better way to handle array data from POST than what I’m doing?
First off let me say, I’m sure there is a better way, I’m not a coder by profession, just a nerd trying to solve a small personal business problem with an app built entirely with html and php. I’m not sure if I’ve done this as efficiently as possible and would like to know if there is …
Is there a way to validade if a field attribute of a product exists in Woocommerce?
I found a youtube tutorial to create a plugin in WordPress to add an input field for each product, so that the client could upload an image. You can add this field attribute to a product or not. The code has a validation function, to check if the image was uploaded or not. If not, promps you a warning saying