ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç customizer/class-astra-customizer-register-surecart-section.php000064400000003720152266307230021222 0ustar00 'ast-surecart', 'type' => 'section', 'priority' => 68, 'title' => __( 'SureCart', 'astra' ), ), ); $surecart_post_types = array( 'sc_product' => array( 'name' => 'section-posttype-sc_product', 'type' => 'section', 'section' => 'ast-surecart', 'title' => __( 'Products', 'astra' ), 'priority' => 69, ), 'sc_collection' => array( 'name' => 'section-posttype-sc_collection', 'type' => 'section', 'section' => 'ast-surecart', 'title' => __( 'Collections', 'astra' ), 'priority' => 70, ), 'sc_upsell' => array( 'name' => 'section-posttype-sc_upsell', 'type' => 'section', 'section' => 'ast-surecart', 'title' => __( 'Upsells', 'astra' ), 'priority' => 71, ), ); return array_merge( $configurations, $_configs, array_values( $surecart_post_types ) ); } } } new Astra_Customizer_Register_Surecart_Section(); class-astra-surecart.php000064400000035432152266307230011335 0ustar00shop_page_id = absint( get_option( 'surecart_shop_page_id' ) ); add_action( 'astra_header_after', array( $this, 'astra_surecart_archive_page_banner_support' ) ); add_action( 'astra_entry_top', array( $this, 'revert_surecart_support' ) ); add_filter( 'astra_page_layout', array( $this, 'sc_shop_sidebar_layout' ) ); add_filter( 'astra_get_content_layout', array( $this, 'sc_shop_content_layout' ) ); add_action( 'wp', array( $this, 'remove_navigation_for_sc_product' ) ); // Boxed layout support. add_filter( 'astra_is_content_layout_boxed', array( $this, 'sc_shop_content_boxed_layout' ) ); add_filter( 'astra_is_sidebar_layout_boxed', array( $this, 'sc_shop_sidebar_boxed_layout' ) ); add_action( 'customize_register', array( $this, 'customize_register' ), 2 ); add_filter( 'astra_theme_defaults', array( $this, 'astra_surecart_default_options' ) ); add_filter( 'astra_archive_post_title', array( $this, 'customize_surecart_archive_title_area' ), 10, 2 ); add_filter( 'astra_single_post_title', array( $this, 'customize_surecart_single_title_area' ), 10, 2 ); add_action( 'admin_bar_menu', array( $this, 'customize_admin_bar' ), 999 ); } /** * Register Customizer sections and panel for SureCart. * * @since 4.6.13 * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function customize_register( $wp_customize ) { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound /** * Register Sections & Panels */ require ASTRA_THEME_DIR . 'inc/compatibility/surecart/customizer/class-astra-customizer-register-surecart-section.php'; } /** * Check is SureCart Shop Page. * * @return bool True if SureCart Shop Page. * @since 4.4.0 */ public function astra_is_surecart_shop_page() { if ( ! is_customize_preview() && ! is_null( $this->shop_page_status ) ) { return $this->shop_page_status; } $this->shop_page_status = false; $supported_post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); if ( ! in_array( $this->post_type, $supported_post_types ) ) { $this->shop_page_status = false; } if ( ! is_page() || ! $this->shop_page_id ) { $this->shop_page_status = false; } $page_id = absint( astra_get_post_id() ); if ( $page_id === $this->shop_page_id ) { $this->shop_page_status = true; } return $this->shop_page_status; } /** * SureCart Shop Sidebar Layout * * @param string $sidebar_layout Layout type. * @return string $sidebar_layout Layout type. * @since 4.4.0 */ public function sc_shop_sidebar_layout( $sidebar_layout ) { if ( $this->astra_is_surecart_shop_page() ) { $sc_shop_sidebar = astra_get_option( 'archive-' . $this->post_type . '-sidebar-layout', 'default' ); if ( 'default' !== $sc_shop_sidebar && ! empty( $sc_shop_sidebar ) ) { $sidebar_layout = $sc_shop_sidebar; } } return apply_filters( 'astra_get_surecart_shop_sidebar_layout', $sidebar_layout ); } /** * SureCart Shop Container * * @param string $content_layout Layout type. * @return string $content_layout Layout type. * @since 4.4.0 */ public function sc_shop_content_layout( $content_layout ) { if ( $this->astra_is_surecart_shop_page() ) { $sc_shop_layout = astra_toggle_layout( 'archive-' . $this->post_type . '-ast-content-layout', 'single', false ); if ( 'default' !== $sc_shop_layout && ! empty( $sc_shop_layout ) ) { $content_layout = $sc_shop_layout; } } return apply_filters( 'astra_get_store_content_layout', $content_layout ); } /** * SureCart Shop Container Style * * @param string $is_style_boxed Layout style. * @return string $is_style_boxed Layout style. * @since 4.4.0 */ public function sc_shop_content_boxed_layout( $is_style_boxed ) { if ( $this->astra_is_surecart_shop_page() ) { $sc_shop_layout_style = astra_get_option( 'archive-' . $this->post_type . '-content-style', 'default' ); if ( 'boxed' === $sc_shop_layout_style ) { $is_style_boxed = true; } } return apply_filters( 'astra_get_store_layout_style', $is_style_boxed ); } /** * SureCart Shop Sidebar Style * * @param string $is_style_boxed Layout style. * @return string $is_style_boxed Layout style. * @since 4.4.0 */ public function sc_shop_sidebar_boxed_layout( $is_style_boxed ) { if ( $this->astra_is_surecart_shop_page() ) { $sc_shop_layout_style = astra_get_option( 'archive-' . $this->post_type . '-sidebar-style', 'default' ); if ( 'boxed' === $sc_shop_layout_style ) { $is_style_boxed = true; } } return apply_filters( 'astra_get_store_sidebar_style', $is_style_boxed ); } /** * SureCart Archive Banner Support. * Making 'Shop Page' as archive of SureCart Products. * * @since 4.4.0 */ public function astra_surecart_archive_page_banner_support() { if ( false === $this->astra_is_surecart_shop_page() ) { return; } $page_id = absint( astra_get_post_id() ); $visibility = get_post_meta( $page_id, 'ast-banner-title-visibility', true ); $visibility = apply_filters( 'astra_banner_title_area_visibility', $visibility ); if ( 'disabled' === $visibility ) { $this->disable_page_loaded_banner_area(); return; } $banner_layout = astra_get_option( 'ast-dynamic-archive-sc_product-layout', 'layout-1' ); add_filter( 'astra_banner_elements_structure', array( $this, 'update_astra_banner_elements_structure' ) ); add_filter( 'astra_banner_elements_post_type', array( $this, 'update_astra_banner_elements_post_type' ) ); add_filter( 'astra_banner_elements_prefix', array( $this, 'update_astra_banner_elements_prefix' ) ); add_filter( 'the_title', array( $this, 'update_the_title' ), 10, 2 ); $title_area_enabled = astra_get_option( 'ast-archive-sc_product-title' ); if ( $title_area_enabled ) { if ( 'layout-2' === $banner_layout ) { $astra_banner_hook = apply_filters( 'astra_banner_hook', 'astra_content_before' ); add_action( $astra_banner_hook, array( $this, 'astra_surecart_hero_section' ), 20 ); } else { add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' ); add_filter( 'astra_apply_hero_header_banner', '__return_false' ); add_action( 'astra_primary_content_top', array( $this, 'astra_force_render_banner_layout_1' ) ); } } } /** * Enable layout 1 for some cases. Ex. SureCart Product. * * @since 4.4.0 * @return void */ public function astra_force_render_banner_layout_1() { add_filter( 'astra_remove_entry_header_content', '__return_false' ); ?>
$this->post_type ); do_action( 'astra_before_archive_' . $this->post_type . '_banner_content' ); get_template_part( 'template-parts/archive', 'banner', $args ); do_action( 'astra_after_archive_' . $this->post_type . '_banner_content' ); $this->disable_page_loaded_banner_area(); } /** * SureCart Section banner element structure. * * @param array $structure Elements structure. * @since 4.4.0 */ public function update_astra_banner_elements_structure( $structure ) { return astra_get_option( 'ast-dynamic-archive-' . $this->post_type . '-structure', array( 'ast-dynamic-archive-' . $this->post_type . '-title', 'ast-dynamic-archive-' . $this->post_type . '-description' ) ); } /** * SureCart Section banner reference post type. * * @param string $post_type Post type. * @since 4.4.0 */ public function update_astra_banner_elements_post_type( $post_type ) { return $this->post_type; } /** * SureCart Section banner prefix. * * @param string $prefix Prefix. * @since 4.4.0 */ public function update_astra_banner_elements_prefix( $prefix ) { return 'archive'; } /** * Support custom title & description support for archive. * * @param string $title Default archive title. * @param int $post_id Post ID. * @since 4.4.0 * @return string */ public function update_the_title( $title, $post_id ) { if ( $this->shop_page_id !== $post_id ) { return $title; } $custom_title = astra_get_option( 'ast-dynamic-archive-' . $this->post_type . '-custom-title', '' ); return ! empty( $custom_title ) ? $custom_title : $title; } /** * Disable Astra's next page's banner as we already loaded. * * @since 4.4.0 */ public function disable_page_loaded_banner_area() { add_filter( 'astra_apply_hero_header_banner', '__return_false' ); add_filter( 'astra_remove_entry_header_content', '__return_true' ); add_filter( 'astra_single_layout_one_banner_visibility', '__return_false' ); } /** * Removed Astra's navigation markup from SureCart single product page. * * @since 4.8.2 */ public function remove_navigation_for_sc_product() { if ( is_singular( 'sc_product' ) ) { remove_action( 'astra_entry_after', 'astra_single_post_navigation_markup' ); } } /** * Revert SureCart Support, after banner loaded. * * @since 4.4.0 */ public function revert_surecart_support() { if ( false === $this->astra_is_surecart_shop_page() ) { return; } remove_filter( 'astra_is_content_layout_boxed', array( $this, 'sc_shop_content_boxed_layout' ) ); remove_filter( 'astra_is_sidebar_layout_boxed', array( $this, 'sc_shop_sidebar_boxed_layout' ) ); remove_filter( 'astra_banner_elements_structure', array( $this, 'update_astra_banner_elements_structure' ) ); remove_filter( 'astra_banner_elements_post_type', array( $this, 'update_astra_banner_elements_post_type' ) ); remove_filter( 'astra_banner_elements_prefix', array( $this, 'update_astra_banner_elements_prefix' ) ); remove_filter( 'the_title', array( $this, 'update_the_title' ), 10 ); } /** * Astra SureCart default options. * * @param array $defaults Array of Astra's options. * @return array Filtered options array. * * @since 4.7.3 */ public function astra_surecart_default_options( $defaults ) { $surecart_post_types = array( 'sc_product', 'sc_collection', 'sc_upsell' ); // Remove the default left and right padding to make it align properly. $surecart_banner_padding = Astra_Posts_Structure_Loader::get_customizer_default( 'responsive-padding' ); if ( isset( $surecart_banner_padding['desktop']['right'] ) ) { $surecart_banner_padding['desktop']['right'] = 0; } if ( isset( $surecart_banner_padding['desktop']['left'] ) ) { $surecart_banner_padding['desktop']['left'] = 0; } foreach ( $surecart_post_types as $post_type ) { $defaults['ast-archive-' . $post_type . '-title'] = false; $defaults['ast-single-' . $post_type . '-title'] = false; $defaults['single-' . $post_type . '-ast-content-layout'] = 'normal-width-container'; $defaults['single-' . $post_type . '-sidebar-layout'] = 'no-sidebar'; $defaults['ast-dynamic-archive-' . $post_type . '-banner-padding'] = $surecart_banner_padding; } return $defaults; } /** * Method to customize SureCart single title area. * * @param string $title Title Area label. * @param string $post_type Current post type. * @param bool $singular Whether singular or plural. * * @since 4.7.3 * @return string Returns customized label for title area. */ public function customize_surecart_title_area( $title, $post_type, $singular = false ) { $surecart_titles = array( 'sc_product' => array( 'single' => __( 'Product', 'astra' ), 'archive' => __( 'Products', 'astra' ), ), 'sc_collection' => array( 'single' => __( 'Collection', 'astra' ), 'archive' => __( 'Collections', 'astra' ), ), 'sc_upsell' => array( 'single' => __( 'Upsell', 'astra' ), 'archive' => __( 'Upsells', 'astra' ), ), ); $type = $singular ? 'single' : 'archive'; // Check for SureCart's post types and customize the title. if ( isset( $surecart_titles[ $post_type ][ $type ] ) ) { $title_area_suffix = ' ' . __( 'Title Area', 'astra' ); return $surecart_titles[ $post_type ][ $type ] . $title_area_suffix; } return $title; } /** * Method to customize SureCart archive title area. * * @param string $title Title Area label. * @param string $post_type Current post type. * * @since 4.7.3 * @return string Returns customized label for archive title area. */ public function customize_surecart_archive_title_area( $title, $post_type ) { return $this->customize_surecart_title_area( $title, $post_type ); } /** * Method to customize SureCart single title area. * * @param string $title Title Area label. * @param string $post_type Current post type. * * @since 4.7.3 * @return string Returns customized label for single title area. */ public function customize_surecart_single_title_area( $title, $post_type ) { return $this->customize_surecart_title_area( $title, $post_type, true ); } /** * Method to add autoFocus query parameter to customize link. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * * @since 4.7.3 * @return void */ public function customize_admin_bar( $wp_admin_bar ) { if ( is_admin() || ! is_admin_bar_showing() ) { return; } // Show only when the user is a member of this site, or they're a super admin. if ( ! is_user_member_of_blog() && ! is_super_admin() ) { return; } // Get the customize node by ID. $node = $wp_admin_bar->get_node( 'customize' ); if ( $node ) { $post_type = get_post_type(); $page = is_singular() ? 'single' : 'archive'; // If the current page is SureCart shop page. if ( 'page' === $post_type && get_the_ID() === get_option( 'surecart_shop_page_id' ) ) { $page = 'archive'; $post_type = 'sc_product'; } // Check for surecart post type. if ( in_array( $post_type, array( 'sc_product', 'sc_collection', 'sc_upsell' ) ) ) { // Add custom parameter to the URL. $node->href = add_query_arg( 'autofocus[section]', "{$page}-posttype-{$post_type}", $node->href ); // Update the node with the modified URL. $wp_admin_bar->add_node( (array) $node ); } } } } /** * Kicking this off by object. * * @since 4.4.0 */ new Astra_SureCart();