No products in the cart.
Forum Replies Created
Viewing 1 post (of 1 total)
- AuthorPosts
-
yahya-ayyoub
ParticipantFirst Creat PHP helper function
function console_output($data) { $output = $data; if (is_array($output)) $output = implode(',', $output); echo "<script>console.log('Debug Objects: " . $output . "' );</script>"; }
Then you can use it like this:
public function calculate_shipping( $package ) { // This is where you'll add your rates $rate = array( 'idea' => $this->id, 'label' => $this->title, 'cost' => '90.00', 'calc_tax' => 'per_item' ); console_output("Calculating shipping"); $this->add_rate($rate); }
This will create an output like this:
Debug Objects: Calculating shipping
- AuthorPosts
Viewing 1 post (of 1 total)