-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify Order, Issues #2163, #194, #662 #2165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor issues, otherwise, A++
while( wpsc_have_purchaselog_details() ) : wpsc_the_purchaselog_item(); ?> | ||
<tr> | ||
while( wpsc_have_purchaselog_details() ) : wpsc_the_purchaselog_item(); | ||
$this->purchase_log_cart_item( $this->can_edit ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use self
, as it is a static method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good.
@@ -599,6 +599,8 @@ function save_to_db($purchase_log_id) { | |||
} | |||
|
|||
do_action( 'wpsc_save_cart_item', $cart_item_id, $this->product_id, $this ); | |||
|
|||
return $cart_item_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice to have a return value here, but let's document it in the doc block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few more minor stylistic changes.
$log_id = absint( $_POST['log_id'] ); | ||
$log = new WPSC_Purchase_Log( $log_id ); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the double blank line here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good.
$item_ids[] = absint( $item_id ); | ||
} | ||
|
||
return _wpsc_init_log_items( $log, $item_ids ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $_POST['product_ids'] is set to an empty array(), it will pass the first condition, but not be iterated through, and the $log variable will not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good.
if ( ! empty( $item_ids ) && in_array( absint( wpsc_purchaselog_details_id() ), $item_ids, true ) ) { | ||
$html .= $cart_item; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the blank line after the control structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@jtsternberg looking noice so far amigo. |
…eckout_Form_Data objects.
…n fact, getting cart contents - we are getting order items - legacy table names be darned.
…, as PHP class names are case-insensitive.
…ing the WPSC_Purchase_Log::update_caches method
…ing the WPSC_Purchase_Log::delete_caches method
@@ -649,7 +650,7 @@ public function get_meta() { | |||
* @access protected | |||
* @since 3.8.9 | |||
* | |||
* @return void | |||
* @return WPSC_Query_Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shan't this actually return a WPSC_Purchase_Log
object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yah it shad
Also _wpsc_doing_it_wrong for when get()-ing 'notes' key
Some testing feedback: Checkout page: https://dl.dropboxusercontent.com/u/16683640/Screenshots/2016-11-15_1959.png Also there is a weird behaviour with both billing/shipping showing/hiding when Shipping address is same as billing enabled And when i increase the product quantity to 2 for all products the overall numbers look confusing a bit to me. You have per item shipping 20$ and 20$ international shipping. The 40 is good IF you count /item shipping for the whole item and not /each item. so if there are 2 Per-item shipping products in cart there is a 40$ shipping + the global flat rate of 20$ i setup ? and, https://dl.dropboxusercontent.com/u/16683640/Screenshots/2016-11-15_2011.png after i increased the quantity. Same on the user account page (Tev1) https://dl.dropboxusercontent.com/u/16683640/Screenshots/2016-11-15_2012.png |
* Kill more $purchlogitem global usage * Add utility methods for getting forms data in different ways * Refactor wpsc_purchaselogs_items to use WPSC_Purchase_Log and WPSC_Checkout_Form_Data objects. * Favor the get_items() method, over get_cart_contents(). We are not, in fact, getting cart contents - we are getting order items - legacy table names be darned. * Capitalize classes WPSC_Cart and WPSC_Cart_Item. Backwards-compatible, as PHP class names are case-insensitive. * Static WPSC_Purchase_Log::update_cache is now just a wrapper for calling the WPSC_Purchase_Log::update_caches method * Static WPSC_Purchase_Log::delete_cache is now just a wrapper for calling the WPSC_Purchase_Log::delete_caches method * Fix typos * Add note about delete_caches params being for back-compat * Add a contextual document title on sales log view pages * Scrutinize PR. * No longer necessary to pass object to update_caches() method. * Docs improvements. * Stub for new wpsc_get_order() helper function. * Log property should be a log object, not checkout form data object. * Add reset method to WPSC_Query_Base * Be sure $exists is set with each fetch() * WPSC_Coupon now also extends WPSC_Query_Base * add WPSC_Purchase_Log::form_data for initiating WPSC_Checkout_Form_Data object * fix shipping_name missing last name * Replace log cart language with "item" * Update @return docs for the fetch methods * Implement contact details editing for logs. * Introduce multiple_meta static key definition, and use to get multiple Also _wpsc_doing_it_wrong for when get()-ing 'notes' key * Introduce better sales log notes. Re: #194, for #2165 * Hookup adding/deleting notes via ajax * Pass item_id to remove_item() method. * move shipping/billing display output to separate methods * Hook up ajax-saving for log-page contact-details editing * Ajax-load payment details as well, since fields are ajax-editable * Move to proper WP metaboxes on log screen * Move to proper WP metaboxes on log screen * Add a edit-contact-details cancel button * Clean up log pagination styling * Include item shipping when calculating the total log shipping total * If we're going to reference a global, we better darn well define it. * Add helper function for payment gateway support checking * Add action for registering metaboxes. * Add base method for processing refunds. * Minor whitespace and docs cleanup
Starting this PR off. Still a bit more work to do, namely: