| 1 |
<?php namespace TierPricingTable\Addons\PluginsRecommendations; |
| 2 |
|
| 3 |
use TierPricingTable\Admin\Tips\Tip; |
| 4 |
|
| 5 |
class BulkPriceEditorPlugin extends Tip { |
| 6 |
|
| 7 |
public function __construct() { |
| 8 |
parent::__construct(); |
| 9 |
|
| 10 |
add_action( 'woocommerce_product_options_pricing', array( $this, 'render' ), - 10 ); |
| 11 |
|
| 12 |
add_filter( 'tiered_pricing_table/admin/tips/get_tip_by_slug', function ( $tip, $slug ) { |
| 13 |
if ( $slug === $this->getSlug() ) { |
| 14 |
return $this; |
| 15 |
} |
| 16 |
|
| 17 |
return $tip; |
| 18 |
}, 10, 2 ); |
| 19 |
} |
| 20 |
|
| 21 |
public function render() { |
| 22 |
|
| 23 |
if ( $this->isSeen() ) { |
| 24 |
return; |
| 25 |
} |
| 26 |
|
| 27 |
$activationDate = \TierPricingTable\TierPricingTablePlugin::getPluginActivationDate(); |
| 28 |
if ( ! $activationDate || ( time() - $activationDate ) < ( WEEK_IN_SECONDS * 2 ) ) { |
| 29 |
return; |
| 30 |
} |
| 31 |
|
| 32 |
?> |
| 33 |
<div class=""> |
| 34 |
<div class="tiered-pricing-tip" |
| 35 |
style="margin: 12px; padding: 10px; background: #fafafa; border: 1px solid #eeeeee; display: flex; gap: 10px; justify-content: space-between"> |
| 36 |
<div style="display:flex; gap: 10px; "> |
| 37 |
<div style="color: #2272b1; margin: 0 5px;"> |
| 38 |
<span class="dashicons dashicons-admin-post"></span> |
| 39 |
</div> |
| 40 |
<div> |
| 41 |
|
| 42 |
<div> |
| 43 |
<strong> |
| 44 |
<?php esc_html_e( 'Tip', 'tier-pricing-table' ); ?>: |
| 45 |
</strong> |
| 46 |
You can update the prices of multiple products at once with the |
| 47 |
<a target="_blank" |
| 48 |
href="https://price-editor.com"> |
| 49 |
<b>Bulk Price Editor plugin</b> |
| 50 |
</a> |
| 51 |
</div> |
| 52 |
|
| 53 |
<div style="margin-top: 10px;"> |
| 54 |
<ul> |
| 55 |
<li>✔️ Add or remove <b>tiered prices</b> in bulk</li> |
| 56 |
<li>✔️ Increase or decrease prices by a certain percentage</li> |
| 57 |
<li>✔️ Add or subtract a fixed amount from prices</li> |
| 58 |
</ul> |
| 59 |
</div> |
| 60 |
|
| 61 |
<div style="margin-top: 10px; display: flex; align-items: center; gap:15px;"> |
| 62 |
|
| 63 |
<a target="_blank" |
| 64 |
class="button" |
| 65 |
href="https://wordpress.org/plugins/bulk-price-editor-for-woocommerce/"> |
| 66 |
<?php esc_html_e( 'Check plugin', 'tier-pricing-table' ); ?> |
| 67 |
</a> |
| 68 |
|
| 69 |
<a target="_blank" |
| 70 |
href="https://www.youtube.com/watch?v=nPA4j53w0iw"> |
| 71 |
<?php esc_html_e( 'View video', 'tier-pricing-table' ); ?> |
| 72 |
<svg style=" |
| 73 |
width: 0.8rem; |
| 74 |
height: 0.8rem; |
| 75 |
stroke: currentColor; |
| 76 |
fill: none;" |
| 77 |
xmlns='http://www.w3.org/2000/svg' |
| 78 |
stroke-width='10' stroke-dashoffset='0' |
| 79 |
stroke-dasharray='0' stroke-linecap='round' |
| 80 |
stroke-linejoin='round' viewBox='0 0 100 100'> |
| 81 |
<polyline fill="none" points="40 20 20 20 20 90 80 90 80 60"/> |
| 82 |
<polyline fill="none" points="60 10 90 10 90 40"/> |
| 83 |
<line fill="none" x1="89" y1="11" x2="50" y2="50"/> |
| 84 |
</svg> |
| 85 |
</a> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
|
| 90 |
<div style="white-space: nowrap;"> |
| 91 |
<a role="button" href="<?php echo esc_attr( $this->getMarkAsSeenURL() ); ?>" |
| 92 |
class="tiered-pricing-tip-close-button"> |
| 93 |
× <?php esc_html_e( 'Hide this tip', 'tier-pricing-table' ); ?> |
| 94 |
</a> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<?php |
| 99 |
} |
| 100 |
|
| 101 |
public function getSlug(): string { |
| 102 |
return 'bulk_price_editor_recommendation'; |
| 103 |
} |
| 104 |
} |
| 105 |
|