Title: Errors shown when image-position not set
Last modified: March 9, 2024

---

# Errors shown when image-position not set

 *  [simonminter](https://wordpress.org/support/users/simonminter/)
 * (@simonminter)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/errors-shown-when-image-position-not-set/)
 * I noticed when using the plugin that sometimes error messages were shown near
   the size charts, regarding `image-position` not being set.
 * I altered this in code to prevent this happening – in `public/includes/productsize-
   chart-contents.php` I changed the following:
 *     ```wp-block-code
       $position_c1 = $assets['chart-1'][0]['image-position'] == 'left' ? 'image-left' : 'image-right';
       ```
   
 * to
 *     ```wp-block-code
       if (isset($assets['chart-1'][0]['image-position'])) {
       	$position_c1 = $assets['chart-1'][0]['image-position'] == 'left' ? 'image-left' : 'image-right';
       } else {
       	$position_c1 = 'image-left';
       }
       ```
   
 * and the following:
 *     ```wp-block-code
       $position_c2 = $assets['chart-2'][0]['image-position-1'] == 'left' ? 'image-left' : 'image-right';
       ```
   
 * to
 *     ```wp-block-code
       if (isset($assets['chart-1'][0]['image-position'])) {
       	$position_c2 = $assets['chart-2'][0]['image-position'] == 'left' ? 'image-left' : 'image-right';
       } else {
       	$position_c2 = 'image-left';
       }
       ```
   
 * This prevents errors occurring. Any chance this change, or a similar one, can
   be incorporated into the plugin code?
 * Thanks!

The topic ‘Errors shown when image-position not set’ is closed to new replies.

 * ![](https://ps.w.org/productsize-chart-for-woocommerce/assets/icon-128x128.jpg?
   rev=1254808)
 * [Product Size Chart for Woocommerce](https://wordpress.org/plugins/productsize-chart-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/productsize-chart-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/productsize-chart-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/productsize-chart-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/productsize-chart-for-woocommerce/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [simonminter](https://wordpress.org/support/users/simonminter/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/errors-shown-when-image-position-not-set/)
 * Status: not resolved