Adding order status to woocommerce-product-attachment plugin
I'm using the woocommerce deposits plugin with DotStore product-attachment plugin but noted that the partially paid order status was not included in the available selections.
After some digging I found that the radio buttons are controlled within the following file...
../wp-content/plugins/woo-product-attachment/admin/class-woocommerce-product-attachment-admin.php
Specifically around lines 950 and 1375. All that was left was to determine what the order status for a partially paid order was.
After sone digging around in the woocommerce deposits plugin I discovered that the status is 'wc-partial-payment', All that was left to do was to create extra radio buttons in the code and assign them the new 'wc-partial-payment' order status.
at about line 976 an extra list element. Just slot it in after the list element for the 'completed' status.
<li><label for="wcpoa_wc_partial_payment">
<input name="wcpoa_order_status[<?php
echo esc_attr( $wcpoa_attachments_id ) ;
?>][]"
class="" value="wcpoa-wc-partial-payment" type="checkbox"
<?php
if ( !is_null( $wcpoa_order_status ) && in_array( 'wcpoa-wc-partial-payment', $wcpoa_order_status, true ) ) {
echo 'checked="checked"' ;
}
?>>
<?php
esc_html_e( 'Partially Paid', $plugin_txt_domain );
?>
</label>
</li>
and again at 1413
<li>
<label for="wcpoa_wc_partial_payment">
<input name="wcpoa_order_status[]" class=""
value="wcpoa-wc-partial-payment"
type="checkbox"><?php
esc_html_e( 'Partial Payment', $plugin_txt_domain );
?>
</label>
</li>
Now downloads can be selected to be made available after customers have made partial payment.
/DM