Title: nafalan's Replies | WordPress.org

---

# nafalan

  [  ](https://wordpress.org/support/users/nafalan/)

 *   [Profile](https://wordpress.org/support/users/nafalan/)
 *   [Topics Started](https://wordpress.org/support/users/nafalan/topics/)
 *   [Replies Created](https://wordpress.org/support/users/nafalan/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/nafalan/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/nafalan/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/nafalan/engagements/)
 *   [Favorites](https://wordpress.org/support/users/nafalan/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets] Product markup based on category](https://wordpress.org/support/topic/product-markup-based-on-category/)
 *  Thread Starter [nafalan](https://wordpress.org/support/users/nafalan/)
 * (@nafalan)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/product-markup-based-on-category/#post-17341335)
 * for anyone how comes across this post the support guy (Diego) gave me an incredible
   solution and was crazy fast.
 * the solution is below:
 * this goes into the regular price section for WooCommerce WP import. Just remember
   to put your references from your CSV/XML for price and category by dragging and
   dropping it.
 *     ```wp-block-code
       [example_adjust_price_by_category({cost[1]},{category[1]})]
       ```
   
 * this goes into the function editor (add categories by copy and pasting a section
   after the break)
 *     ```wp-block-code
       function example_adjust_price_by_category ($price, $category = '') {
   
       	if ( !empty($category) ) {
   
       		switch($category) {
       			case 'Shoes':
       				return $price * 1.2;
       				break;
       			case 'Jackets':
       				return $price * 1.4;
       				break;
       			default:
       				// No category specified, so we return nothing
       				break;
       		}
   
       	}
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets] Product markup based on category](https://wordpress.org/support/topic/product-markup-based-on-category/)
 *  Thread Starter [nafalan](https://wordpress.org/support/users/nafalan/)
 * (@nafalan)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/product-markup-based-on-category/#post-17341182)
 * I’ve just submitted a ticket and I hope we can find a solution for this.

Viewing 2 replies - 1 through 2 (of 2 total)