I want to change the price of the products according to the weight with a variable amount. Such as silver, as the price changes on day to day basis so the price will be calculated with the amount I insert for 1gm silver. For example, a product is of 300gm and the price for 1 gm silver is 2000 bucks then 300*2000 = 600,000 bucks. The silver price will change daily and the price will be calculated according to that for all the products. Is there any plugin available for that or if it is possible with some code change I can do that. Help me out with this issue. Thanks
How to change the price of all the products with a constant variable according the weight of the products in wordpress?
1.9k Views Asked by puneet At
2
There are 2 best solutions below
0
kscherrer
On
As far as I know, there is no plugin for that. Since the prices change daily, you should create a cronjob task as Erik van de Ven suggested. With that you can update the prices which you store in a database or in a file. Your wordpress-code can then read from that db/file, where the prices should now always be up to date
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in WORDPRESS
- Ajax jQuery firing multiple time display event for the same result
- Retrieving *number* pages by page id
- How to change the name of the file during unzip?
- Pass variables to extended class
- Dynamic wordpress background Based on Slider images
- I want to remove certain parent- and child-divs in all my wordpress posts with php or some other script
- Wordpress limit post that subscriber can create
- CSS styles for all instances of a WordPress widget
- Detect the function that redirects the page
- Show success or error messages in Ajax response to Wordpress custom registration form
- Internal 500 server error: .htaccess: RewriteCond: bad flag delimiters
- Rerun loop after every third post? (Wordpress)
- Error 404 not going after Wordpress Permalink change to custom structure
- YouTube views not counting on Wordpress embed
- Include only specific categories in WooCommerce product categories widget
Related Questions in WOOCOMMERCE
- Include only specific categories in WooCommerce product categories widget
- woocommerce add custom price while add to cart
- fabricjs: how to show object size after scaling
- WooCommercer/WP - Add custom field output to admin-new-order email
- Alignment issues with Woocommerce Checkout
- How to set payment method in Woocommerce via PHP
- Wordpress how to override function get_order_report_data from wc_admin_report
- WooCommerce add to cart validation: prevent add to cart
- Get parent product thumbnail filter in WooCommerce Cart and Checkout Page
- Determine whether on shop page in woocommerce
- name and the path of the file to edit the related product prices in woocommerce
- Woocommerce PayPal sandbox not getting disabled
- Editing Checkout Page - WooCommerce
- How to add user roles dropdown in registration and login woocommerce wordpress
- WordPress - Failing to override woocommerce templates
Related Questions in COMMODITY
- Error in "Quandl" while pulling data for commodity in R
- Quandl - Converting JSON data into data frame uisng R
- jQuery function to find which button in table row is clicked
- Commodity Term Structure Data from Bloomberg
- Commodity Futures Cascading in Python
- How can we get commodity prices in R?
- What is "Commodity Software"?
- Trick to getting commodities price history in Quantmod R?
- Compare MAPE for markets with different volatilities
- How to get Soybean commodity price into Google Sheet: Simple solution
- MATLAB Yahoo data feed error
- Why does my VAR model in R have low p-values and zero degrees of freedom in the serial correlation test?
- How to change the price of all the products with a constant variable according the weight of the products in wordpress?
- Service and/or Commodity
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Here is an solution, which you can modify to your needs, basically what it does is bulk updating the price based on the price you entered ( Current Price per Gram ).
Step 1 Add a new page on
wp-admincalled "Price Update"Step 2 Create a custom template on your theme's directory called
page-price-update.phpand paste the following snippet on that template fileStep 3 Put the following snippet on your theme's
functions.phpNow visit that page (
http://your-domain/price-update) and do your price update.