Issue with Copying Array
This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see green button on the right side) and press Save button.If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from Mattia on August 19, 2019, 02:50Hi, I am trying to copy an array in different products with the "binded editing" method you describe in your videos, however I encounter an issue, the array is not copied and in the product page I get this error in place of the array:
Warning: Invalid argument supplied for foreach() in /home/ucpa4911/public_html/wp-content/themes/adventure-tours/templates/admin/tour-booking-row.php on line 88
How can I solve this?
Hi, I am trying to copy an array in different products with the "binded editing" method you describe in your videos, however I encounter an issue, the array is not copied and in the product page I get this error in place of the array:
Warning: Invalid argument supplied for foreach() in /home/ucpa4911/public_html/wp-content/themes/adventure-tours/templates/admin/tour-booking-row.php on line 88
How can I solve this?
Quote from Mattia on August 19, 2019, 02:56This is the code in the file that the error refers to:
<?php
87 $row_exact_dates = isset( $row['exact_dates'] ) ? $row['exact_dates'] : array();
88 foreach ( $row_exact_dates as $_date ) {
89 echo adventure_tours_render_template_part( $exact_date_template, '', array(
90 'value' => $_date,
91 'row_field_name' => $row_field_name,
92 ), true );
93 }
94 ?>
I downloaded the array in a csv, this is how it looks like there:
[{"exact_dates":["2019-02-03","2019-02-10"],"limit":"100","spec_price":"200","mode":"exact-dates","type":"1","from":"2019-02-03","to":"2019-02-10"}]
This is the code in the file that the error refers to:
<?php
87 $row_exact_dates = isset( $row['exact_dates'] ) ? $row['exact_dates'] : array();
88 foreach ( $row_exact_dates as $_date ) {
89 echo adventure_tours_render_template_part( $exact_date_template, '', array(
90 'value' => $_date,
91 'row_field_name' => $row_field_name,
92 ), true );
93 }
94 ?>
I downloaded the array in a csv, this is how it looks like there:
[{"exact_dates":["2019-02-03","2019-02-10"],"limit":"100","spec_price":"200","mode":"exact-dates","type":"1","from":"2019-02-03","to":"2019-02-10"}]
Quote from Mattia on August 19, 2019, 03:09Here is a video screenshot of the array type that I am trying to copy, as it appears in WOOBE: https://drive.google.com/file/d/1nf_-1iFo8hZrqlgE8qR14VGxmUkp2RVQ/view?usp=sharing
Hope this issue can be solved, the plug in would solve me a huge amount of time in inserting this arrays manually!
Here is a video screenshot of the array type that I am trying to copy, as it appears in WOOBE: https://drive.google.com/file/d/1nf_-1iFo8hZrqlgE8qR14VGxmUkp2RVQ/view?usp=sharing
Hope this issue can be solved, the plug in would solve me a huge amount of time in inserting this arrays manually!
Quote from Pablo Borysenco on August 19, 2019, 11:48Hello
https://c2n.me/439wwl9.png - It must be an array. unfortunately the plugin cannot add another level
Try to add ["2019-02-03","2019-02-10"]
Hello
https://c2n.me/439wwl9.png - It must be an array. unfortunately the plugin cannot add another level
Try to add ["2019-02-03","2019-02-10"]
Quote from Mattia on August 19, 2019, 13:56No I am not able to make it work. Do you think there is a work around so that I can obtain what I am trying to do? I am not interested in the visualisation of the arrays, I would be more than happy to be able just to copy the arrays in text format, for example just pasting this:
[{"exact_dates":["2019-02-03","2019-02-10"],"limit":"100","spec_price":"200","mode":"exact-dates","type":"1","from":"2019-02-03","to":"2019-02-10"}]
in text form. Is there a way this could be achieved?
No I am not able to make it work. Do you think there is a work around so that I can obtain what I am trying to do? I am not interested in the visualisation of the arrays, I would be more than happy to be able just to copy the arrays in text format, for example just pasting this:
[{"exact_dates":["2019-02-03","2019-02-10"],"limit":"100","spec_price":"200","mode":"exact-dates","type":"1","from":"2019-02-03","to":"2019-02-10"}]
in text form. Is there a way this could be achieved?
Quote from Pablo Borysenco on August 20, 2019, 11:12Hello
Try to add this code: https://c2n.me/43aG2wT.png
if(!is_array( $row_exact_dates )){
$row_exact_dates=explode (",",$row_exact_dates );
}
Hello
Try to add this code: https://c2n.me/43aG2wT.png
if(!is_array( $row_exact_dates )){
$row_exact_dates=explode (",",$row_exact_dates );
}
Quote from Mattia on August 20, 2019, 22:10This seems to work! I'll test it further, if no issues this is awesome, it will save me so many hours of work!
This seems to work! I'll test it further, if no issues this is awesome, it will save me so many hours of work!
Quote from Mattia on August 21, 2019, 01:36Not completely there yet, can now see the touir periods successfully added back end, but in the front end I get this error:
Warning: Invalid argument supplied for foreach() in /home/ucpa4911/public_html/wp-content/themes/adventure-tours/includes/classes/AtTourBookingService.php on line 376
and the code on that file is this:
373. $times = !empty( $period['times'] ) ? $period['times'] : array();
374.
375. if ( ! empty( $period['exact_dates'] ) ) {
376. foreach ( $period['exact_dates'] as $_date ) {
377. //TODO improve!
378. $this->expand_times( $result, $_date, $expanded_value, $times );
379. }
380. }
381.
382. return $result;
383. }
384.
385. protected function expand_period_default( $period, $expanded_value, $step = '+1 day' ) {
386. $result = array();
387.
388. $iterationsLimit = $this->expandIterationsLimit > 1 ? $this->expandIterationsLimit : 5000;
389.
390. $curTime = $this->to_time( $period['from'] );
391. $endTime = $this->to_time( $period['to'] );
Is there anything that can be done to make it work?
Not completely there yet, can now see the touir periods successfully added back end, but in the front end I get this error:
Warning: Invalid argument supplied for foreach() in /home/ucpa4911/public_html/wp-content/themes/adventure-tours/includes/classes/AtTourBookingService.php on line 376
and the code on that file is this:
373. $times = !empty( $period['times'] ) ? $period['times'] : array();
374.
375. if ( ! empty( $period['exact_dates'] ) ) {
376. foreach ( $period['exact_dates'] as $_date ) {
377. //TODO improve!
378. $this->expand_times( $result, $_date, $expanded_value, $times );
379. }
380. }
381.
382. return $result;
383. }
384.
385. protected function expand_period_default( $period, $expanded_value, $step = '+1 day' ) {
386. $result = array();
387.
388. $iterationsLimit = $this->expandIterationsLimit > 1 ? $this->expandIterationsLimit : 5000;
389.
390. $curTime = $this->to_time( $period['from'] );
391. $endTime = $this->to_time( $period['to'] );
Is there anything that can be done to make it work?
Quote from Mattia on August 21, 2019, 02:02I discovered the issue is solved if the product is updated in the back end, it looks like it needs to refresh the product after the WOOBE work to import the new data in the front end booking system. Is that something that can be done automatically without me going into each product and clicking update?
I discovered the issue is solved if the product is updated in the back end, it looks like it needs to refresh the product after the WOOBE work to import the new data in the front end booking system. Is that something that can be done automatically without me going into each product and clicking update?
Quote from Pablo Borysenco on August 21, 2019, 11:09Hello
Try to add code - https://c2n.me/43bVpEf.png
if(!is_array( $period['exact_dates'] ){
$period['exact_dates'] =explode (",",$period['exact_dates'] );
}
Hello
Try to add code - https://c2n.me/43bVpEf.png
if(!is_array( $period['exact_dates'] ){
$period['exact_dates'] =explode (",",$period['exact_dates'] );
}
Quote from Mattia on August 21, 2019, 15:27unfortauntely it doesn't work. That way I can get to see them in the front end but the dates are still not actually bookable. I believe the key lies into updating the product after the changes are applied
unfortauntely it doesn't work. That way I can get to see them in the front end but the dates are still not actually bookable. I believe the key lies into updating the product after the changes are applied
Quote from Pablo Borysenco on August 22, 2019, 11:10Hello
Unfortunately, I cannot offer anything else.
Hello
Unfortunately, I cannot offer anything else.
Quote from Mattia on August 24, 2019, 21:18It's ok don't worry, even with this issue it still works pretty well for me. Thanks for developing the plug in and for the support!
It's ok don't worry, even with this issue it still works pretty well for me. Thanks for developing the plug in and for the support!
Quote from Pablo Borysenco on August 26, 2019, 12:07Hello
Welcome;)
Hello
Welcome;)