Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Store Customization > Ensure the Just Arrived Full Hero pattern can have an AI selected image assigned to it #11159

Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions patterns/just-arrived-full-hero.php
Expand Up @@ -9,29 +9,31 @@
$content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/just-arrived-full-hero' );
$images = PatternsHelper::get_pattern_images( 'woocommerce-blocks/just-arrived-full-hero' );

$image1 = PatternsHelper::get_image_url( $images, 0, 'images/pattern-placeholders/plant-in-vase.jpg' );
$pattern_title = $content['titles'][0]['default'] ?? '';
$pattern_description = $content['descriptions'][0]['default'] ?? '';
$pattern_button = $content['buttons'][0]['default'] ?? '';
$pattern_image = PatternsHelper::get_image_url( $images, 0, 'images/pattern-placeholders/plant-in-vase.jpg' );
?>

<!-- wp:cover {"url":"<?php echo esc_url( $image1 ); ?>","dimRatio":0,"minHeight":739,"contentPosition":"center right","isDark":false,"align":"wide","style":{"spacing":{"padding":{"right":"4em"}}}} -->
<div class="wp-block-cover alignwide is-light has-custom-content-position is-position-center-right" style="padding-right:4em;min-height:739px">
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-0 has-background-dim"></span>
<img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $image1 ); ?>" data-object-fit="cover"/>
<!-- wp:cover {"url":"<?php echo esc_url( $pattern_image ); ?>","dimRatio":30,"minHeight":739,"contentPosition":"center right","align":"wide","style":{"spacing":{"padding":{"right":"4em"}}}} -->
<div class="wp-block-cover alignwide has-custom-content-position is-position-center-right" style="padding-right:4em;min-height:739px">
<span aria-hidden="true" class="wp-block-cover__background has-background-dim-30 has-background-dim"></span>
<img class="wp-block-cover__image-background" alt="" src="<?php echo esc_url( $pattern_image ); ?>" data-object-fit="cover"/>
<div class="wp-block-cover__inner-container">
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading {"anchor":"just-arrived"} -->
<h2 class="wp-block-heading" id="just-arrived"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h2>
<h2 class="wp-block-heading" id="just-arrived"><?php echo esc_html( $pattern_title ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $content['descriptions'][0]['default'] ); ?></p>
<p><?php echo esc_html( $pattern_description ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons">
<!-- wp:button -->
<div class="wp-block-button">
<a class="wp-block-button__link wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html( $content['buttons'][0]['default'] ); ?></a>
<a class="wp-block-button__link wp-element-button" href="<?php echo esc_url( get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php echo esc_html( $pattern_button ); ?></a>
</div>
<!-- /wp:button -->
</div>
Expand Down
23 changes: 16 additions & 7 deletions patterns/testimonials-3-columns.php
Expand Up @@ -6,24 +6,33 @@
*/

use Automattic\WooCommerce\Blocks\Patterns\PatternsHelper;

$content = PatternsHelper::get_pattern_content( 'woocommerce-blocks/testimonials-3-columns' );

$main_header = $content['titles'][0]['default'] ?? '';
$first_title = $content['titles'][1]['default'] ?? '';
$second_title = $content['titles'][2]['default'] ?? '';
$third_title = $content['titles'][3]['default'] ?? '';
$first_description = $content['descriptions'][0]['default'] ?? '';
$second_description = $content['descriptions'][1]['default'] ?? '';
$third_description = $content['descriptions'][2]['default'] ?? '';
?>
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"layout":{"type":"constrained","justifyContent":"left"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30)">
<!-- wp:heading {"level":3,"style":{"spacing":{"padding":{"right":"var:preset|spacing|30","left":"var:preset|spacing|30"}}}} -->
<h3 class="wp-block-heading" style="padding-right:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><?php echo esc_html( $content['titles'][3]['default'] ); ?></h3>
<h3 class="wp-block-heading" style="padding-right:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)"><?php echo esc_html( $main_header ); ?></h3>
<!-- /wp:heading -->

<!-- wp:columns {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|30","left":"var:preset|spacing|30"}}}} -->
<div class="wp-block-columns alignfull" style="padding-right:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)">
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:paragraph -->
<p><strong><?php echo esc_html( $content['titles'][0]['default'] ); ?></strong></p>
<p><strong><?php echo esc_html( $first_title ); ?></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $content['descriptions'][0]['default'] ); ?></p>
<p><?php echo esc_html( $first_description ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
Expand All @@ -36,11 +45,11 @@
<div class="wp-block-column">
<!-- wp:paragraph -->

<p><strong><?php echo esc_html( $content['titles'][1]['default'] ); ?></strong></p>
<p><strong><?php echo esc_html( $second_title ); ?></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $content['descriptions'][1]['default'] ); ?></p>
<p><?php echo esc_html( $second_description ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
Expand All @@ -52,11 +61,11 @@
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:paragraph -->
<p><strong><?php echo esc_html( $content['titles'][2]['default'] ); ?></strong></p>
<p><strong><?php echo esc_html( $third_title ); ?></strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><?php echo esc_html( $content['descriptions'][2]['default'] ); ?></p>
<p><?php echo esc_html( $third_description ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
Expand Down
10 changes: 6 additions & 4 deletions src/Patterns/dictionary.json
Expand Up @@ -256,6 +256,8 @@
{
"name": "Just Arrived Full Hero",
"slug": "woocommerce-blocks/just-arrived-full-hero",
"images_total": 1,
"images_format": "landscape",
"content": {
"titles": [
{
Expand Down Expand Up @@ -584,6 +586,10 @@
"slug": "woocommerce-blocks/testimonials-3-columns",
"content": {
"titles": [
{
"default": "What our customers say",
"ai_prompt": "A title that advertises the set of testimonials"
},
{
"default": "Great experience",
"ai_prompt": "A title that advertises the first testimonial"
Expand All @@ -595,10 +601,6 @@
{
"default": "Awesome couch and great buying experience",
"ai_prompt": "A title that advertises the third testimonial"
},
{
"default": "What our customers say",
"ai_prompt": "A title that advertises the set of testimonials"
}
],
"descriptions": [
Expand Down