وردپرس

My Account Template Issue | WordPress.org


Hi team,

In reviewx, you have a partial file overwriting woocommerce’s default order table (wp-content/plugins/reviewx/partials/storefront/myaccount/order-table.php) but this template is deprecated and troublesome in major ways:

  • it has inconsistent content (each order is duplicated in multiple lines for each of its items)
  • is set to version 7.0.1, and we are already in Woocommerce 8.5.0
  • it does not use woo’s best practices
  • it runs business logic in the template partial !!
  • it slows down the user’s “My Orders” page.

Here are what I suggest for a long term solution:

-> Instead of having this partial, use woo’s filters and hooks to integrate your features. More below.

-> Add Only ONE order column (using woo’s filter woocommerce_account_orders_columns, I saw you use it already, needs cleaing) that would have as content for each order a simple ul list of product names with a review action (you can also add a tooltip to show the product image on hover, but not required). Example:

-> Manage order actions using woo’s filter woocommerce_my_account_my_orders_actions

-> Migrate all business logic (calculations) in another place in your plugin and get the data via async ajax call so your plugin would not slow down the user’s “My Orders” page.

-> avoid adding your css classes or ids to partials and templates. Use specific and precise selectors using existing native classes and make sure to load your style files ONLY when absolutely required to not impact performance.

Best.

PS: I believe ChatGPT would be very helpful fixing all the points in couple of minutes with your expertise ?

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا