texts: Magento 2.3.1 Base table or view not found

texts:
Magento 2.3.1 keep filling logs with these errors:

  system.log

[2019-05-04 23:30:12] report.INFO: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_category_product_index_store0` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=0 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id=0
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '0' AND price_index.customer_group_id = 0 WHERE ((`e`.`entity_id` IN(23262))) AND (e.created_in <= '1556754420') AND (e.updated_in > '1556754420') [] []
[2019-05-04 23:30:12] report.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento231.catalog_category_product_index_store0' doesn't exist, query was: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_category_product_index_store0` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=0 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id=0
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '0' AND price_index.customer_group_id = 0 WHERE ((`e`.`entity_id` IN(23262))) AND (e.created_in <= '1556754420') AND (e.updated_in > '1556754420') [] []

system.log is filled with these two errors.

I don't see a problem somewhere or maybe I didn't notice.

I use a two language store. In the times I see in log only crons are running but in their log I don't have issue.All crons successful finished.

Can anyone help me where to check please?


texts: on click of Product image redirect to external website product details in Magento 2

texts:
Is it possible to add external links to the product via admin dashboard?

on  click of product image redirect the user to product description page which is on external domain.
screenshot of product
https://puu.sh/xW4vr/ae64d82537.png

live link screenshot of product description
https://puu.sh/xW4yS/ad3f4b82ba.png

dev live link screenshot of product description
https://puu.sh/xW4y2/42be2acb3f.png

for example : live site URL
https://www.example.com/product-luggage-rack-wood-20-in-h-holds-300-lb-lrwstd01.html

Redirect to
dev site
https://www.example.dev.com/product-luggage-rack-wood-20-in-h-holds-300-lb-lrwstd01.html


texts: Delta Migration: Integrity constraint violation: 1062 Duplicate entry

texts:
I have successfully done data migration.
After migration, we placed order, create product and test everything.
Now when we trying to run delta migration (also tried -a it is giving error like:

Its seems issue with related product link
Thanks in Advance!


texts: Change knockout a href data-bind to link to image

texts:
Is there anyway to change this href to image url?
Its from Magento Checkout module copied to my theme Magento_Checkout/web/template/minicart/item/default.html

I was trying to change to this:

<a data-bind="attr: {href: product_image, title: product_name}"

but no success.


texts: Error while upgrading Magento 2.3.3 to 2.3.4

texts:
When I run the Setup Upgrade Command. Getting below error

Notice: Undefined index: column in /vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php on line 196


texts: How to show payment method in admin only ? (Magento 1)

texts: What is the best way to enable a Payment Method only in backend part in Magento 1?


texts: Not able to add product options (configurable product) into a separate tab

texts:
I need to add product options (preference tab) to a new tab along Descrition, Additional, Tags, Review etc like in image.

I am using below xml layout in <catalog_product_view>.

<reference name="product.info.additional">
        <action method="unsetChild"><name>product_tag_list</name></action>
        <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
            <action method="setTemplate" ><template>catalog/product/view/tabs.phtml</template></action>
            <action method="addTab" translate="title" module="catalog" ><alias>preferences_tabbed</alias><title>Preferences</title><block>catalog/product_view_options</block><template>catalog/product/view/preferences.phtml</template></action>
            <action method="addTab" translate="title" module="catalog" ><alias>description_tabbed</alias><title>Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
            <action method="addTab" translate="title" module="catalog" ><alias>additional_tabbed</alias><title>Additional</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
            <action method="addTab" translate="title" module="tag" ><alias>tags_tabbed</alias><title>Tags</title><block>tag/product_list</block><template>tag/list.phtml</template></action>
            <action method="addTab" translate="title" module="review" ><alias>review_tabbed</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product_info_review.phtml</template></action>
        </block>
    </reference>

catalog/product/view/preferences.phtml has this bunch of code copied from view.phtml. I know what it does.

<?php if ($this->getProduct()->isSaleable() && $this->hasOptions()):?>
    <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>

I don't have idea how to declare container2 as child inside the Preferences tab.

Please help me if you have an idea.


texts: How can i make fit my products image within the image box

texts: When i import my images, its not fit to image box, how can i make fit for image box, for new products.


texts: Disable Ajax Add to Cart on the Product page in Magento 2

texts:
how to disable Ajax ‘Add to Cart’ button on the Magento 2 product page
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "Magento_Catalog/product/view/validation": {
                "radioCheckboxClosest": ".nested"
            }
        }
    }
</script>


texts: Magento 2 Update record/table with where clause

texts:
How can I update record with multiple where clause? I know below method to update record with single where condition.  I tried to used addFieldToFilter()
but not succeeded.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order_ = $objectManager->create('<ext_name>\<module_name>\Model\OrderSaleslist')
                                       ->load($orderId);
$order_->setSellerOrderConfirm("dispatched");
$order_->save();

I want to apply below query.

Update ordersaleslist set seller_order_confirm = 'dispatched', payment_mode = 'COD' where order_id = 1 and product_id = 20 and (status !='' OR dispatched_status!='');

Thanks in Advance.


texts: How to get recently viewed products collection of Customer Magento 2?

texts:
Magento 2 get recently viewed products collection of Customer (Using customer ID) programmatically

I tried this solution But I want recently viewed products collection.

I tried below solution too but it is not returning anything. [I am logged in]

protected $recentlyViewed;

public function __construct(
...
    \Magento\Reports\Block\Product\Viewed $recentlyViewed
) {
...
    $this->recentlyViewed = $recentlyViewed;
}

/**
 * Get recently viewed products for the customer
 *
 */
public function getMostRecentlyViewed(){
    return $this->recentlyViewed->getItemsCollection();
}


texts: What am I doing wrong with this nested block

texts:
I am using magento 1.9 and want to insert cookie restriction notice block on my page

then try to render it in my homepage.phtml

but got nothing

and this static block(cookie restriction notice block) is enabled


texts: Magento2: Mysql Database Slowquery log generating and Magento2 Website going down

texts:
Below error showing when Website going down
Any one know solution?
When I restart server then website run again.
But I want to know why server log showing below error.

INSERT INTO search_tmp_5c8199b30f59f9_84922976 SELECT main_select.entity_id, SUM(score) AS relevance FROM (SELECT DISTINCT  search_index.entity_id, (((0) + (0) + (0)) * 1) AS score FROM catalog_product_index_eav AS search_index
 INNER JOIN catalog_product_index_eav AS brand_filter ON search_index.entity_id = brand_filter.entity_id AND (search_index.source_id = brand_filter.source_id OR brand_filter.entity_id = brand_filter.source_id) AND brand_filter.attribute_id = 272 AND brand_filter.store_id = 1
 INNER JOIN catalog_product_index_eav AS size_filter ON search_index.entity_id = size_filter.entity_id AND (search_index.source_id = size_filter.source_id OR size_filter.entity_id = size_filter.source_id) AND size_filter.attribute_id = 132 AND size_filter.store_id = 1
 INNER JOIN cataloginventory_stock_status AS stock_index ON stock_index.product_id = search_index.entity_id AND stock_index.website_id = 0 AND stock_index.stock_id = 1
 INNER JOIN cataloginventory_stock_status AS sub_products_stock_index ON sub_products_stock_index.product_id = search_index.source_id AND sub_products_stock_index.website_id = 0 AND sub_products_stock_index.stock_id = 1
 INNER JOIN catalog_category_product_index AS category_ids_index ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1' WHERE (search_index.store_id = '1') AND (category_ids_index.category_id = 101) AND (brand_filter.value = '1677') AND (size_filter.value  IN ('318', '1175', '9'))) AS main_select GROUP BY entity_id ORDER BY relevance DESC, entity_id DESC
 LIMIT 10000;


texts:
We have a magento website, which is currently in development stage.

we tried to install a open-source "market-place" plugin. It was not working as expected. After uninstalled the plugin. The website is showing the below error

  Source model "marketplace/source_option" not found for attribute "seller_id"

Please can you suggest how to resolve this issue.


texts:
I`m having a strange issue with catalog searching.

Performing this simple search returns 35 products :

catalogsearch/result/index/?q=bac

However, when I refine it by category, I still receive the same number of products including products from other categories

i.e. search :

/catalogsearch/result/index/?cat=3&q=bac

This is all with the default magento products.


texts: Magento 2: How to create multiple select filters with apply button in layered navigation

texts:
We are trying to add multiple select filters to apply button for layered navigation in Magento 2.1.0 with Smile Elastic Suite.

I have created a jQuery script to get all multiple selected option and split taking only params in array like below.

  isconsumablefor=325,isconsumablefor=326,isconsumablefor=327,sets_pcs=225,sets_pcs=228

So now how to convert this array and make single url with repeated params?

Our filters look like

My script is like :

 $(".apply-filters").on("click",function(e){
         e.preventDefault();
            var val=[];
            var queryString= [];
            var hash;
            $("input[name='type']:checked").each(function() {
            val.push($(this).val().slice($(this).val().indexOf('?') + 1).split('&'));

            });
           alert(val);
        });

Alert result is:

  isconsumablefor=325,isconsumablefor=326,isconsumablefor=327,sets_pcs=225,sets_pcs=228

So help me to create single url to load products using filter params

in website multi attribute select will be like below "http://localhost/magento2/shop/kitchen.html?attribute1[0]=20&attribute11=30&attribute2[0]=21" so i am not getting the checked box value only for same attribute


texts:
I implement the facebook pixel code on my magento store in the head section. I use this code snippet from github:
https://gist.github.com/rafaelstz/4dcaecae4318eb552b48

This snippet not works with my "add to cart" because I use Ajax. How I can trigger "fbq('track', 'AddToCart');" with ajax requests?


texts:
When i run magento command i get this error.

[Exception]
  Warning: is_file() expects parameter 1 to be a valid path, string given in
  /opt/lampp/htdocs/mij_new_design/vendor/colinmollenhour/cache-backend-file/
  File.php on line 512


texts:
I am trying to add a CMS page from backend to show a form from external link as given below in the code.

But i am unable to display the form on the page as all the div or script tag gets replaced by some ASCII code.

The code that i am trying to add to the CMS Page is

I am using the normal backend process in admin panel to do this.

But the result in front end is same like some text floating on the page.All the code is replaced in between by some ASCII character.

Note: I am re posting this question because someone had put it on hold and even after edit did not bother to unhold the question or reply.


texts: Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later error on php 5.6 using system

texts:
I am using magento 2.2.3 and php vesion is 5.6.3. After running the project It gives error "Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read Magento System Requirements." Magento manual says that php 5.6 is  a supporting version.How can I fix this issue?

Edit:
The problem is that I don't want PHP 7.1 because it is not supported by a plug-in I am using. So I'd rather install 7.0.6 or some other PHP version in the 7.0.x series supported by Magento. But I am unable to install a specific version of PHP. How can I specify the exact version of PHP while installing in Ubuntu 16.04


texts: How i Stop "Add to cart" redirect "checkout/cart/" in magento 2

texts: I had done some changes from this this then products can not add to cart that redirect to checkout/cart in magento 2.I removed sections.xml file and excute setup:static-content:deploy but problem can not solve.how i stop "add cart" TO "checkout/cart/" and I want "add product" to "cart"


texts: Value index is not specified for an option - Magento 2 API

texts:
I'm getting the error at below, when i try to set the configurable attribute, to create configurable product via Magento 2 API:

as described in: http://devdocs.magento.com/guides/v2.2/rest/tutorials/configurable-product/define-config-product-options.html

{"message":"Value index is not specified for an option."}

my code is:

$sampleProductData = array(

'option' => array(
    'attribute_id' => 150,
    'label' => 'Shoe Size',
    'position' => 0,
    'is_use_default' => true,
    'values' => array(
        'value_index' => '8' ),
), );

$productData = json_encode($sampleProductData);

IMPORTANT NOTE:

150 is 'Shoe Size' attribute ID, and 8 is the shoe size 37's ID


texts: Rewrite magento catalog search url using xml

texts:
I need a rewrite rule for catalogsearch to rewrite url from :

  localhost/magento/catalogsearch/result/?q=product

TO:

  localhost/magento/?q=product

How to write rewrite in xml please help me.


texts: Observer for all order creation in frontend and admin

texts:
I have a problem with observer. I want to send order data to somewhere after creating that order. I need to make it for all possible ways of creating an order (frontend and backend).

Observer for checkout_onepage_controller_success_action is working fine, but i need it even for creating it in administration. This is an example of my config.xml (first event works):

<global>
    <events>
        <checkout_onepage_controller_success_action>
            <observers>
                <postDataFromOrderToServer>
                    <type>singleton</type>
                    <class>PixelDesign_DataResender_Model_Observer</class>
                    <method>postDataFromOrderToServer</method>
                </postDataFromOrderToServer>
            </observers>
        </checkout_onepage_controller_success_action>
    </events>
</global>
<adminhtml>
    <events>
        <adminhtml_sales_order_create_process_data>
            <observers>
                <postDataFromOrderToServer>
                    <type>singleton</type>
                    <class>PixelDesign_DataResender_Model_Observer</class>
                    <method>postDataFromOrderToServer</method>
                </postDataFromOrderToServer>
            </observers>
        </adminhtml_sales_order_create_process_data>
    </events>
</adminhtml>


texts: how do i add this addAttribute manually in database according to this code?

texts:
i've a extension to install, the following code is in setup file

$installer->addAttribute('customer', 'facebook_uid', array(
        'type'   => 'varchar',
        'label'     => 'Facebook Uid',
        'visible'   => false,
        'required'  => false
));

but the code is conflict with existing database, i have to add this manually via backend or phpmyadmin


texts: Missing cross-selling and related products option in admin

texts:
I notice in several websites about Magento mentioning the "Related Products", "Up-Sells" and "Cross-Sells" options in the admin backend under the "Manage Products" section.

However, when I log into my Magento backend, I could only see the "Up-Sells" option. The other two options, "Related Products" and "Up-Sells" are missing from the menu.

How can I get "Related Products" and "Up-Sells" options to show up on in the admin backend?


texts: Magento 2 - product details tab title as an clickable link url to another page

texts:
How to make the product details tab title is clickable link, and grab the SKU from the current product page to the link?

For example, I created a custom product tab called "Download", and when click on "Download" product detail tab, it will open a new tab for www.abc.com/download/?keyword=SKU


texts: Overriding Files from third party module

texts:
I'm new to Magento 2 and still trying to get my head around the folder hierarchy.

If I want a file from my theme to replace a file in a module I am doing the following.

For css, original file that I want to override is here.

vendor\supplier\module-search-autocomplete\src\SearchAutocomplete\view\frontend\web\css\source\module_cssfile.less

I have copied it to the below location for edit.

app\design\frontend\themesupplier\my_theme\module-search-autocomplete\src\SearchAutocomplete\view\frontend\web\css\source\module\_cssfile.less

php file.

Original is:-

src\vendor\supplier\module-search-autocomplete\src\SearchAutocomplete\Index\Magento\Catalog\Product.php

Copied to:-

app\design\frontend\themesupplier\my_theme\module-search-autocomplete\src\SearchAutocomplete\Index\Magento\Catalog\Product.php

Where did I go wrong ?

I am flushing the cache and also have tried client side compile mode, but changes do not show up.

Clearly I have got the pathing wrong for the copied file, but where ?


texts:
I tried to change the attribute value once we click on Place Order button present in checkout page :

config.xml  :

<sales_convert_quote_to_order>
    <observers>
        <example_place_order>
            <class>Amasty_Example_Model_Observer</class>
            <method>PlaceOrder</method>
        </example_place_order>
    </observers>
</sales_convert_quote_to_order>

app/code/local/Amasty/Example/Model - Observer.php

public function PlaceOrder($observer)
{
    $product = $observer->getEvent()->getProduct();
    Mage::getSingleton('catalog/product_action')->updateAttributes(
        array($product->getId()),
        array('cart_status' => 0),
        $storeId = 0
    );
}

Result

  Call to a member function getProduct() on a non-object in line: $product = $observer->getEvent()->getProduct();


texts: Can I add extra fields to the a Magento 2 static block?

texts: I'd like to add something similar to a category drop down to Magento 2's static block. Is this possible, if so can somebody set me off in the right direction?


texts:
I am developing a small custom module. While creating an admin screen under system->configuration, I am getting following error Fatal error: Class 'Mage_Screen_Helper_Data' not found in /app/Mage.php on line 546

I checked my code but nothing seems wrong. Below is the code of my config.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Study_Screen>
            <version>0.1.0<version>
        </Study_Screen>
    </modules>
    <global>
        <models>
            <screen>
                <class>Study_Screen_Model</class>
            </screen>
        </models>
        <helpers>
            <screen>
                <class>Study_Screen_Helper</class>
            </screen>
        </helpers>
        <blocks>
            <screen>
                <class>Study_Screen_Block</class>
            </screen>
        </blocks>
    </global>
    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <screen translate="title" module="screen">
                                            <title>Screen Settings</title>
                                        </screen>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>

Next I created Data.php in Helper folder. The code for Data.php is

 <?php
class Study_Screen_Helper_Data extends Mage_Core_Helper_Data
{
}
?>

and at last i created system.xml in etc folder. Code for system.xml is

<?xml version="1.0"?>
<config>
    <sections>
        <screen translate="label" module="screen">
            <label>Screen</label>
            <tab>sales</tab>
            <frontend_type>text</frontend_type>
            <sort_order>1000</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
        </screen>
    </sections>
</config>

Everything seems to be fine. I can't figure out the error. Any help will be appreciated.


texts:
I found almost how the print button is created on the invoice page (invoked from vendor/magento/module-backend/view/adminhtml/templates/widget/button.phtml) with the debug option in Magento2. I would like to add in directly on the order page to avoid going to the invoice page each time. I can't find the exact code that need to be added to my custom adminhtml to add it.
I would like to find how to add the function who generate this code :
<button id="print" title="Print" type="button" class="action-default scalable print" onclick="setLocation('MAGENTO_URL/admin/sales/order_invoice/print/invoice_id/ID/')" data-ui-id="sales-invoice-view-print-button">
    Print
</button>

If possible to add like after the view link or as a button on the order information tab since I already have some custom code for this page:

Thanks in advance


texts:
We just had about 20 httpd processes that were sitting there chewing CPU for over 20 minutes, I am wondering why something like that might happen....

Any ideas are greatly appreciated because I am confused, a quick restart of apache, and the processes never came back.


texts: Checkout Submit Event Observer, huge delays while loading

texts:
I am trying to use an Event Observer to run some code after the user checks out. This is what i have so far:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

   <event name="checkout_submit_all_after">
       <observer name="vendor_module_observer_oncheckout" instance="vendor\module\Observer\Oncheckout" />
   </event>

</config>

This is the Observer File:

<?php
namespace vendor\module\Observer;

class Oncheckout implements \Magento\Framework\Event\ObserverInterface
{

  public $_observer;
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
     $order = $observer->getOrder();
     $orderid = $order->getId();

     //adds $orderid to the database

  }

}

From some research i have done, this is the correct code, and it does work successfully. However, it takes over 1 minute for the code to finish executing and redirect the user to the checkout success page.

What am i doing wrong that causes such a long delay? Without this code, the checkout success page loads up in seconds.

Thanks.

EDIT:

With some investigation, I have found that the module causes the payment-information post request to remain in the pending state for 2.1 minutes

after further testing, the time in the pending state is consistently 2.1 minutes every time


texts:
I have successfully created a customer order total Zero VAT Cylinder Deposit and have made it appear on the credit memo page. However, as you can see below, my only option is to refund the entire amount at once. I'd prefer it to be like the shipping with a text input where I can define the refund amount.

Can anyone offer any solutions or at least point me in the right direction of which files I need to examine to do this for my custom total?

I'll be putting the entire module on GitHub when it's finished which should help others.

-------------------- EDIT --------------------

I now have the input box showing up (below), however the refund amount is always the full amount regardless of the number I enter. If I enter a custom price and click 'Update Qtys' it reverts back to the original deposit total (the full amount).

My question now is if anybody knows how I can make Magento take notice of the custom price I might enter into the deposit field, instead of refunding the full deposit amount?


texts:
I have googled but i didnt found what i was looking for.

I want to log, activity from visitors (page views, products added to cart, custom events) and when the visitor log in, associate that activity to the user id. Or if the visitor isn't a customer when she register do the same thing. Or even if the visitor isn't a customer, when she subscribes to the newsletter, associate that activity to their email address.

a) How extensive is the visitor and customer url log actually is? It logs every page view for customers and/or visitors?

b) On visitor_log_url table is a session_id column. Where is set the Lifetime? How is it renewed? How can i call it in order to add it to newsletter_subscriber or to add it on log_quote?

c) Or maybe someone could recommend an extension that does something like this?

Regards,
Alex

V: Magento 1.9.3


texts: Stop an out-of-stock product returning to the product page when you add it to your cart

texts:
At the moment, if I add an item to my product which is out-of-stock, it goes to the product page with an "out of stock" message.

However, what I want is for it to still go to the cart page, but have an "out of stock" message there instead.

I am generating my link to add the product to the cart as follows: Mage::helper('checkout/cart')->getAddUrl($_newProduct);


texts: How to check customers custom attribute order place in Magento 2

texts:
How to check customer custom attribute is 'No' order is pending. And customer custom attribute is 'Yes' Order is processing.
So please How to achieve this.
Thanks


texts: Get Current URL in Magento including sub-pages of that URL and show something

texts:
I already know how to get a specific URL in Magento and show something. It was already resolved in this page: https://stackoverflow.com/questions/25192212/get-current-url-in-magento-and-show-something

However, I noticed that it will only show what I want to show in the page alone. If I browse through its subpages, it doesn't show anymore.

For example the URL of my magento site is magento.com. And want to show something in magento.com/blog, thus I'll use this method:

$currentUrl = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
$path = $url->getPath();
$blogPaths = array('/blog', '/blog/', '/index.php/blog/');
if(in_array($path, $blogPaths))
{
    //Do something on /blog
}

However, when I browse to a specific page on that subpage, for example, magento.com/blog/another-page-within-the-blog-page, the element that I'm trying to show disappears. It only appears in magento.com/blog

How can I let it appear in /blog, and all the pages under /blog?

I have tried array /blog/* but it didn't work. I guess what I did is simply not right. :(


texts: Friends recently I heard that Magento 2.3 will include react JS with it but I don't know what is the use of it and on what positions it will be used please share some Good resource SO I can understand the same.


texts: Magento 2 - How to call Newsletter in PWA venia theme

texts: How can I add Newsletter in PWA Magento 2.4 venia theme ?


texts:
Is it possible to create a new REST API to update or create data in all magento tables from a xml added in POST :

<data>
    <row table="Nom_Table_1" key="Nom_Champ_Key_1">
        <column name="Nom_Champ1" type="string">value1</column>
        <column name="Nom_Champ2" type="integer">5</column>
        <column name="Nom_Champ3" type="double">21.5</column>
        <column name="Nom_Champ4" type="date_time">2018-09-24T15:22:27.000+02:00</column>
    </row>
    <row table="Nom_Table_2" key="Nom_Champ_Key_2">
        <column name="Nom_Champ1" type="string">value1</column>
        <column name="Nom_Champ2" type="integer">7</column>
    </row>
</data>


texts: get configurable product ordered quantity from quote

texts:
I am using below code for fetching the ordered quantity for products, the value is correctly fetched for simple product. but in case of configurable product the quantity remains 1.

foreach ($quote->getAllItems() as $item){
        $buyrequest = $item->getBuyRequest();
        $qty = $buyrequest->getQty();
}

i even tried $item->getQtyOrdered().


texts: Extend Header (logo, search box and cart) in Magento 2

texts: I am trying to extend the Header (logo, search box and cart), but those files are the different location. I don't know how to adjust those. Could you please suggest me on this.


texts: Magento 2- How to translate text in Knockout .html file

texts:
I want to translate KO text.

"You have no items in your shopping cart."  "Empty Basket"

Already tried with translate.csv it doesn't work.

Is there any way to translating knockout template text in magento2?


texts: how to replace block in output in magento2?

texts:
I need to render products list page with custom ids which should be passed like
http://mymagentostore.com/?ids=1,2,3,4,5 (or any other controller action instead of cms_index_index)

For this purpose, I am observing layout_generate_blocks_after event and want to change block from cms_page to my custom block in layout object.

I am trying this code in my observer:

public function execute(
        \Magento\Framework\Event\Observer $observer
    ) {
        $layout = $data['layout'];
        $block  = $layout->createBlock('\Company\Module\Block\CustomList');
        $layout->getBlock('cms_page')->append($block);
      }

But I cant see that \Company\Module\Block\CustomList block toHtml method is calling, why ?


texts:
SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'mavikmarine_l2li.m_catalog_product_flat_1_tmp_indexer' doesn't exist,
  query was: UPDATE m_catalog_product_flat_1_tmp_indexer AS et
  INNER JOIN m_catalog_product_entity AS e ON e.entity_id =
  et.entity_id  INNER JOIN m_catalog_product_entity_text AS t ON
  t.entity_id = e.entity_id AND t.attribute_id=181 AND t.store_id = 1
  AND t.value IS NOT NULL SET et.codazon_custom_tab = t.value


texts:
My old site had tens of thousands of no-longer-valid products with
urls like http://example.com?product_id=123456.

They are all search-engine indexed and now resolve to 404 in Magento. I cannot possibly create a redirect for every single one.

How do I get them to resolve to my home page?


texts: how to add custom fields into a website/store?

texts: I need to add additional fields in the website, store and store view, including - store type, store pictures, contact number, store hours, store longitude, and latitude. The Store type will be a drop down list to allow people to choose the type etc. Could someone provide detailed steps for how to make this change?


texts: Move to fresh database don't take non standard items

texts:
I would like to take standard core data (i.e products, orders, attributes, etc) from my magento 1.9.2.2 store into a fresh 1.9.2.2 database without any of the extra data and fields that have been added by other modules.

has anyone else done this? or have any advice on how to do it?

Thanks


texts:
I try to do the Magento 2 update from 2.0.2 to 2.0.7 using the command.

composer require magento/product-community-edition 2.0.4 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

But after the first 2 commands I get the message:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package /product-community-edition could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Where does the package product-community-edition come from? Do I need to upload it or make any connection?


texts:
I am showing Listrak on site recommend product on my website.
Product images are very big, I need resizes images.
I have images name like 2/0/20mm.jpg and I am appeding it with https://example.com/media/catalog/product
So it will be

https://example.com/media/catalog/product/2/0/20mm.jpg

But i want

https://example.com/media/catalog/product/cache/fc6ca0131474e1299ecedb80f5002264/2/0/20mm.jpg

Note: I do not have product object, So can't load an get resized images that why need to get cache folder path so I will append image name.
Thanks in advance!


texts: How to overwrite a payment method js renderer component?

texts:
Resolved: Seems the error has been caused by the requirejs and my lobster hands :) I rewrite a default Component and trying to extend it inside own component which rewrites a default component: recursion.

Note: I know about this answer and it is good, but my question is about JS error when overwriting a renderer using my way.

I've created a map for standard Magento offline payment method renderer:

  app/code/MageWorx/Checkout/view/frontend/requirejs-config.js

var config = {
    map: {
        '*': {
            'Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method':
                'MageWorx_Checkout/js/view/payment/method-renderer/purchaseorder-method'
        }
    }
};

and here the my component in where I want to change a regular (default) template of this payment method:

define([
    'Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method',
    'jquery',
    'mage/validation'
], function (Component, $) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'MageWorx_Checkout/payment-method/renderer/purchaseorder-form'
        }
    });
});

Seems good, but... It does not work, because of error:

  "TypeError: Cannot read property 'extend' of undefined  at
  http://1001101010.com/pub/static/frontend/Magento/blank/en_US/MageWorx_Checkout/js/view/payment/method-renderer/purchaseorder-method.js:12:22
  at Object.execCb
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:1650:33)
  at Object.context.execCb
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/mage/requirejs/resolver.js:145:31)
  at Module.check
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:861:55)
  at
  http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:616:33
  at each
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:57:31)
  at breakCycle
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:605:17)
  at
  http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:618:29
  at each
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:57:31)
  at breakCycle
  (http://1001101010.com/pub/static/frontend/Magento/blank/en_US/requirejs/require.js:605:17)"

But if I change my component next way (total copy with changed template) it start working without any error:

define([
    'Magento_Checkout/js/view/payment/default', //'Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method',
    'jquery',
    'mage/validation' ], function (Component, $) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'MageWorx_Checkout/payment-method/renderer/purchaseorder-form',
            purchaseOrderNumber: ''
        },

        /** @inheritdoc */
        initObservable: function () {
            this._super()
                .observe('purchaseOrderNumber');

            return this;
        },

        /**
         * @return {Object}
         */
        getData: function () {
            return {
                method: this.item.method,
                'po_number': this.purchaseOrderNumber(),
                'additional_data': null
            };
        },

        /**
         * @return {jQuery}
         */
        validate: function () {
            var form = 'form[data-role=purchaseorder-form]';

            return $(form).validation() && $(form).validation('isValid');
        }
    });
});

Where is error?


texts: Magento 2.3.5 - API error The "array" class doesn't exist and the namespace must be specified

texts:
We get the following API error on our Magento 2.3.5 store;
The "array" class doesn't exist and the namespace must be specified. Verify and try again.

More info;
<![CDATA[#0 /vendor/magento/module-webapi/Model/Config/ClassReflector.php(103): Magento\Framework\Reflection\TypeProcessor->register('array') #1 /vendor/magento/module-webapi/Model/Config/ClassReflector.php(72): Magento\Webapi\Model\Config\ClassReflector->extractMethodData(Object(Laminas\Code\Reflection\MethodReflection)) #2 /vendor/magento/module-webapi/Model/ServiceMetadata.php(133): Magento\Webapi\Model\Config\ClassReflector->reflectClassMethods('Mollie\\Payment\\...', Array) #3 /vendor/magento/module-webapi/Model/ServiceMetadata.php(166): Magento\Webapi\Model\ServiceMetadata->initServicesMetadata() #4 /vendor/magento/module-webapi/Model/ServiceMetadata.php(189): Magento\Webapi\Model\ServiceMetadata->getServicesConfig() #5 /vendor/magento/module-webapi/Model/Soap/Wsdl/Generator.php(367): Magento\Webapi\Model\ServiceMetadata->getServiceMetadata('iCEShopICECatCo...') #6 /vendor/magento/module-webapi/Model/AbstractSchemaGenerator.php(172): Magento\Webapi\Model\Soap\Wsdl\Generator->getServiceMetadata('iCEShopICECatCo...') #7 /vendor/magento/module-webapi/Model/Soap/Wsdl/Generator.php(375): Magento\Webapi\Model\AbstractSchemaGenerator->getAllowedServicesMetadata(Array) #8 /vendor/magento/module-webapi/Model/AbstractSchemaGenerator.php(107): Magento\Webapi\Model\Soap\Wsdl\Generator->getAllowedServicesMetadata(Array) #9 /vendor/magento/module-webapi/Controller/Soap.php(134): Magento\Webapi\Model\AbstractSchemaGenerator->generate(Array, 'https', 'domain.com', 'domain.com'') #10 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Soap->dispatch(Object(Magento\Framework\App\Request\Http)) #11 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Soap\Interceptor->___callParent('dispatch', Array) #12 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Soap\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #13 /generated/code/Magento/Webapi/Controller/Soap/Interceptor.php(26): Magento\Webapi\Controller\Soap\Interceptor->___callPlugins('dispatch', Array, Array) #14 /vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Soap\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #15 /vendor/magento/framework/App/Bootstrap.php(261): Magento\Framework\App\Http->launch() #16 /pub/index.php(40): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #17 {main}]]>


texts: Get all products that has special price and special price < price

texts:
I want to get all products that has special price and special price < price.

Can anyone show me how can i achieve that ?


texts: Filter product collection to include only one parent configurable product

texts:
So I'm trying to build a 'Bestseller list' on our homepage. Currently the bestseller list is only showing the top selling simple products. All these simple products are child products of different configurable products.

So to visualise my problem, this is my current bestseller list

Simple product 59589 - Child product of configurable product 30
Simple product 234 - Child product of configurable product 56
Simple product 80085 - Child product of configurable product 30
Simple product 666 - Child product of configurable product 56

What I want is for this list to look like this:

Configurable product 30
Configurable product 56

I currently have the following code:

 $cat = Mage::getModel('catalog/category')->load(13);
 $_productCollection = Mage::getResourceModel('reports/product_collection');
 $_productCollection->addOrderedQty();
 $_productCollection->addAttributeToSelect('*');
 $_productCollection->addCategoryFilter($cat);
 $_productCollection->setOrder('ordered_qty', 'desc');
 $_productCollection->setPageSize(6)->setCurPage(1);

I have no idea how to go from here. The only thing I can think of is loading all products and doing a while loop?


texts: Change Alt Attributes 1 time for 4 websites

texts:
I'm working for the company Alterego_Design.

For the SEO, I Have to complete all ALT attributes of each product (we have +- 900 products)

But, we have 4 websites regrouped in Magento, and I have to make the work 4 times... With the loading of MAgento, it makes me a very long time to complet even 1 article...

Can you help me please ?

Here is a picture :

And when I complet the Alt attributes in "Valeur par défaut" >"Default Value", it doesn't work, so I have to complete theses ALT in each storeview !

Have you a solution to do that faster ?

Thanks


texts: Join tables with foreign key relationship

texts:
I wrote an admin module with a form, which consists of a text area and a dynamic-row form component.

My data is split up in two custom tables with a FK/PK relationship.

I need to populate my form component with this data, so I performed a table join inside my collection class.

    $this->getSelect()->join(
            ['secondTable' => $this->getTable('calcengine_calcparams')],
            'main_table.Calc_id = secondTable.MyCalc_id',
            array('*')
        );

Next in my DataProvider I tried to recieve this data.

class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider
{

  ...

  public function getData()
  {
        if (isset($this->_loadedData)) {
            return $this->_loadedData;
        }

        $items = $this->collection->getItems();

        ...
  }

}

But I'll always recieve this error:

  Item (Vendor\Module\Model\Calcforms) with the same ID "11" already exists.

Does anybody have an idea how to populate my form with a joined table?


texts: how to get product id for a particular product in product details page?

texts: I dont know how to implement this task. I want to display product Id in product view page. Can you please help me?


texts: Magento 2 - Add a template block in a CMS page via layout update

texts:
I'm trying to include a new template block in a CMS page in the admin via layout updates.
Here is the xml:

<block class="Magento\Catalog\Block\Product\View\Description" name="homepage.carousel" template="homepage/carousel.phtml" before="-" />

The carousel template has been added in [theme-folder]/Magento_Theme/templates/homepage/carousel.phtml. Then I run:

bin/magento cache:flush
bin/magento setup:static-content:deploy

No luck, so then I moved the template to [theme-folder]/Magento_Cms/templates/homepage/carousel.phtml. I re-run the above commands but still no luck. Then I changed the CMS page "New Theme" and set it to my custom theme and re-run the above commands and still no luck.
Any suggestions?


texts:
we have recently installed an apc cache for our magento shop and it works so far.
Now we have a new module using ioncube Loader and as far as we now know these two things are not compatible.
The module only works in the backend so I hope to find  a way to deactivate apc for backend area.
But I can't find an option in the apc config to do so.
Isn't it possible to restrict the apc?


texts: Using group() in Magento EE with SOLR breaks pagination in Magento

texts:
When using GROUP BY (MySQL statement) on collections in Magento CE, we need to apply something similar to https://stackoverflow.com/questions/3485455/using-group-breaks-getselectcountsql-in-magento so we can get GROUP BY working fine.

I'm wondering has anyone resolve similar issue in Magento EE when using SOLR search. Listing / Search show proper number of results in all pages but pages has different #of results. Also getSelectCountSql returns wrong # of results.

Thanks


texts: Magento 2: How to remove decimal points in special price column in product admin grid

texts: I want to remove decimal points from special price column in product admin grid.


texts: HTTP POST and RESPONSE Action from Admin Dashboard

texts:
I am looking to build a module that needs to do POST actions then handle the response details.

I understand how to do this from the frontend but am unsure how to fully implement this within the dashboard. Are there any simple examples of this you could provide or recommend an extension that performs similar actions I could look at?


texts: Magento2: Minicart doesn't show items in the dropdown popup

texts:
I'm using Magento version 2.1.1 and facing issue that minicart is not showing added items in the cart.

In firebug, its showing this error message: "TypeError: this.itemRenderer is undefined"

Any help would be appreciated.


texts:
In header.phtml I add new banner:

 x
  BLACK WEEK!: TYLKO TERAZ NAWET DO -63%* NA +150 MAREK PREMIUM!

But now this banner is displayed in Polish language on all stores website. How can I translate this banner for others websites stores?


texts: How do I upgrade Magento 2.4 using composer?

texts:
How do I upgrade Magento 2.4 using composer to e.g. Magento 2.4.1 or Magento 2.4.2 or Magento 2.4.3 for that matter?
We've been reading https://devdocs.magento.com/guides/v2.4/comp-mgr/cli/cli-upgrade.html
But every time we run into problems with missing modules and similar issues. Also the guide is a 'catch all situations guide' like moving from community ot enterprise and v.v. --
We just want to move from 2.4 to 2.4.1
Would this be the following, clear concise or can it be better?
bin/magento maintenance:enable
composer require magento/product-community-edition=2.3.3-p1 --no-update
composer update
rm -rf var/cache/* var/page_cache/* generated/code/*
bin/magento setup:upgrade
bin/magento maintenance:disable
service varnish restart #(optional, often can only be done by root)


texts: Magento 2.1.7 product page 404 after migration

texts:
I migrated all of the data from a Magento 1.9 build to Magento 2.1.7 everything has gone well. categories are showing, products are in the categories, product images are showing on backend and category pages, all settings have migrated.

However I have one issue, every single product page when clicking from the category returns the Magento 404 and the product pages don't seem to exist, still using luma base theme for testing.

Debug/exception/error logs show nothing.

The category image/text above links to the following URL:

domain-name.com/basins/express-corner-basin-and-pedestal

as expected as per the Magento 1 build.

When editing the product in the backend:

I've re-indexed/cleared cache/ran magento:upgrade. At the end of my knowledge of what could be causing this - has anyone had this issue/have any suggestions on what to try next?

EDIT: Manually added a new product through the admin panel - same result 404 error page, shows in category fine.


texts: I want to change the frontend of checkout page like picture below, i can find the phtml at onepage.phtml for checkout page, but i can't change the frontend because it's all script. How can i change the frontend then? for example, if i want to remove the shipping method at checkout page?


texts:
I'm using magento 1.8.10.

How to avoid fake orders ?
Is there any way to verify mobile numbers also or something else to
avoid fake Orders ?


texts:
I am doing an integration with our other systems where I am trying to create a simple product (for now) in Magento 2.0.0 (will update soon but in the middle of this) using a rest call. I have tried both post and put and both work but for some odd reason the price, weight and tax code I send are ignored. All three fields are present in the payload (triple checked). No error just ignored and all three are left empty.

Anyone know if there is something specific about these three fields? I haven't tried updating the product yet so I don't know if that works.


texts:
I am working on a magerun command, but it seems that errors are not triggered. E.g.

protected function execute(InputInterface $input, OutputInterface
$output)
{
    $this->detetMagento($output);
}

If I misspell detectMagento and run the command, it does nothing, I would expect an Exception to be thrown or some other error triggered... There's also nothing in the logs. Obviously, this doesn't work really well ;)

What am I missing here?


texts:
How can I create a new STATIC Product attribute in Magento 2?

We use barcode as a unique identifier (same as SKU) and are considering adding this - same as sku - as a STATIC attribute directly to product entity table

Why? We think this is faster during lookups ...

But we are not sure where/how this could unexpected problems

In short: How can I create a new STATIC Product attribute in Magento 2? And will this work?


texts:
We are devoloping a "toys for kids" magento site.

So we are planning for main categories = Boys & girls.

along with that we have to filter products as "0-2 years" , "2-4" years, "4-6years"..etc.

I guess it's similar like "shop by price[0-100] , [100-200] & shop by color".

you can see demo here, below gallery images  : http://www.templatemonster.com/demo/46006.html

please guide me to find solution.


texts:
After patching new security update can't get past checkout, have reverted but still no luck.

It gets past payment info and shipment info its only when I click "Place Order" it does not load the next page, only thing that comes up in logs is:

ERR (3): Warning: strpos(): Empty needle  in /public_html/lib/Zend/Controller/Request/Http.php on line 508
ERR (3): Warning: strpos(): Empty needle  in /public_html/lib/Zend/Controller/Request/Http.php on line 514

Any way I can find the route of this problem?

Update:

Fixed the issue with the log clearing up but still can't place order.


texts: magento 1 append block into another block

texts:
I have google map section as one block .
and i want to add my block into checkout billing address block.
i did like this code

<reference name="content">

  <reference name="checkout.onepage">
    <reference name="checkout.onepage.billing">
      <block  type="core/template"  name="delivery_index"  template="delivery/index.phtml" />
    </reference>
 </reference>
</reference>

but that did not work !
is there any way for me ?


texts: What config.xml settings can be set in the database?

texts:
I'm looking to learn more about the internals of Magento!

I recently used Inchoo's tutorial to allow administrators to set a crontab schedule from System > Configuration. See it here. In it, I noticed that a setting which is usually set in config.xml is being set in the database table core_config_data instead.

Normal config.xml method:

<crontab>
    <jobs>
        <my_custom_crontab>
            <schedule><cron_expr>* * * * *</cron_expr></schedule>
            <run><model>mymodule/observer::hookMethod</model></run>
        </my_custom_crontab>
    </jobs>
</crontab>

Alternate Database Record:

scope   scope_id    path                                                value
default 0           crontab/jobs/my_custom_crontab/schedule/cron_expr   * * * * *

Can anyone tell me

What config settings can be located in the database, or if all of them can be.
Where Magento's logic (code) to pull these values from the database lives.
What the hierarchy looks like / what is given priority.

One side effect I've noticed from storing these config.xml settings in the database is that they suddenly have scope. (default, website, store, store view.) I'm not aware of replicating such scope in the config.xml files, so I'm also wondering how that figures in.

Thanks!


texts: bash: stty: command not found error in SSH

texts:
I'm trying to install applications from the Magento Repository via Bitvise SSH, but I'm getting the following error in all cases (this case is an attempt to install the Data Migration tool) right after it prompts me for a password (I have no opportunity to enter a password): bash: stty: command not found

datasolv@am17 [~/public_html/catalog]# composer require magento/data-migration-tool:2.1.0
./composer.json has been updated
Loading composer repositories with package information
    Authentication required (repo.magento.com):
      Username: <public key>
      Password: bash: stty: command not found


texts:
I want to replace this JS.

\vendor\magento\module-catalog\view\base\web\js\price-options.js

I did try override by

\app\design\frontend\(vendor)\(theme)\Magento_Catalog\view\base\web\js\price-options.js

But seems not right...please help


texts:
Magento 2 in admin grid display order table data. How to display this?

can you give me any suggestions please?


texts: Magento setup:upgrade command is not working

texts: When I hit magento setup:upgrade. I got error following error


texts: DIFFERENCE BETWEEN ONLINE AND OFFLINE SHIPPING METHOD

texts: I am working on a custom Magento module. I am facing some issues to debug the code and one question that comes into my mind is that what is the difference between offline and online shipping method. Try to elaborate Magneto docs explain Offline Shipping here  but I have to understand it more deeply


texts: AND inside OR in where condition in getCollections()

texts:
Need to generate the following query with getCollection() however unable to figure it out.

(id_path = '12/xyz') OR (request_path = '/abc' AND store_id = '1')

Tried the following but I need it the other way:

//gives (...) AND (.. OR ..)

$collection->addFieldToFilter('id_path', '12/xyz');
$collection->addFieldToFilter(
    array('store_id', 'request_path'),
    array('1', '/abc')
 );


texts: I'm using Magento and I need a solution to implement custom tax rate

texts:
I have the following tax setting now

Subtotal: $10.00
Shipping & Handling: $5.00
Tax (at the moment just using 10% of Subtotal) (10%):$1.00
Grand Total: $16.00

And I want it like :

Subtotal: $10.00
Shipping & Handling: $5.00
Tax (need it to be 10% of subtotal [which is working]
 AND 10% of 54% of shipping & Handling) (10%): $1.27 [$1 as 10% of subtotal and $0.27 for $2.70(which is 54% of $5.00 shipping cost) ]
Grand Total: $16.27

Thank you,


texts: magento 2.3: get CMS page content in template file

texts:
I want to get CMS page content and title in phtml template file.
How can I get this?

I am trying below code to get content but it's not working -

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$content = $objectManager->create('\Magento\Cms\Model\Page');
$content->load('my_page_identifier', 'identifier');
echo $content->getContent();

Please provide a solution.


texts: Remove Decimal in Set Product Magento 1.9.3

texts: I am new in Magento and I can't find the solution to remove the decimal values in the standard number in Set/Bundle Products in the Admin Panel. I used ET Currency manager but it only affects the prices in the admin panel. I am using magento 1.9.3


texts: Not able to move "Porto" theme top links under header content (After search) in Magento 2.3.2

texts:
I am using Porto theme (header Type 1) with Magento 2.3.2 setup.
I want to move Top Links section elements i.e : Sign in, Currency etc under the header content after the mini search bar.

Here is the code that I am using :

  app/design/frontend/Smartwave/porto/Magento_Theme/layout/default.xml

    <referenceBlock name="authorization-link-login" remove="true" />

    <referenceContainer name="header-wrapper">
        <container name="sign-in-div" htmlTag="div" htmlClass="signin-wrap" after="top.search">
            <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-custom" template="Magento_Theme::account/link/authorization.phtml" />
        </container>
    </referenceContainer>

1) The first line works fine, it removes the default one.
2) But the code under "referenceContainer" didn't work :(

I have tried the same code in Magento default setup and it works fine for me, but not with the Porto theme.

Thanks !


texts:
We are talking about a class Mage_Catalog_Model_Resource_Category_Indexer_Product

When you upgrade the product through admin panel, the position of product calculated in _refreshAnchorRelations()

github link

$position = 'MIN('.
    $adapter->getCheckSql(
    'cp.category_id = ce.entity_id',
    'cp.position',
    '(cc.position + 1) * ('.$adapter->quoteIdentifier('cc.level').' + 1) * 10000 + cp.position'
    )
.')';

You can look about it here

But when you use reindex shell, like php shell/indexer.php --reindex catalog_category_product then position of product calculated in reindexAll()

github link

$position = 'MIN('.
    $idxAdapter->getCheckSql(
    'ca.category_id = ce.entity_id',
    $idxAdapter->quoteIdentifier('cp.position'),
    '('.$idxAdapter->quoteIdentifier('ce.position').' + 1) * '
    .'('.$idxAdapter->quoteIdentifier('ce.level').' + 1 * 10000)'
    .' + '.$idxAdapter->quoteIdentifier('cp.position')
    )
.')';

There is seen in difference the formulas:

1) (child category position + 1) * (child category level + 1) * 10000 + ( product position in catalog_category_product + 1)

2) (child category position + 1) * (child category level + 1 * 10000) + ( product position in catalog_category_product + 1)

The question: is this bug or feature?


texts: Is any way to use Google Invisible reCaptcha in Magento 1.9 admin login?

texts: How can I use Google Invisible reCaptcha in Magento 1.9 admin login?


texts:
I am trying to add a block on my checkout page but for some reason its not working.

<block type="core/template" name="checkout.cart.consultant" as="consultant" template="checkout/cart/consultant.phtml"/>

file path

  layout/template/checkout/cart/consultant.phtml

What am I missing?


texts: How can I save the custom option value in Magento 2 database?

texts: How can I save this custom value in database and get in the cart page with the custom option ?


texts: How to get all orders except the ones with specific status

texts:
I am using Magento 1.9.2 and i am working on a custom extension.

Here is what code i use to select all orders with specific status:

<?php $_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status', 'complete'); ?>

How can i select all orders except the ones with specific status?

Here is the complete code of the .phtml where i use the code shown above:

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status', 'complete') ?>

<?php echo $this->__('My Orders') ?>

<?php echo $this->getChildHtml('info');?>
<?php echo $this->getPagerHtml(); ?>
<?php if($_orders->getSize()): ?>

    <col width="1" />
    <col width="1" />
    <col />
    <col width="1" />
    <col width="1" />
    <col width="1" />

            <?php echo $this->__('Order #') ?>
            <?php echo $this->__('Date') ?>
            <?php echo $this->__('Ship To') ?>
            <?php echo $this->__('Order Total') ?>
            <?php echo $this->__('Order Status') ?>
            &nbsp;

        <?php $_odd = ''; ?>
        <?php foreach ($_orders as $_order): ?>

            <?php echo $_order->getRealOrderId() ?>
            <?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?>
            <?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?>
            <?php echo $_order->formatPrice($_order->getGrandTotal()) ?>
            <?php echo $_order->getStatusLabel() ?>

                <a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?>
                    <?php /*|<a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?>&nbsp;*/ ?>
                    <?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
                    | <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?>
                <?php endif ?>

        <?php endforeach; ?>

<?php echo $this->getPagerHtml(); ?>
<?php else: ?>

<?php echo $this->__('You have placed no orders.'); ?>

<?php endif ?>

Thanks in advance!


texts: Magento 2 CAPTCHA not showing when enabled

texts:
Hope that someone may provide some guidance with an issue at hand .. and my limited knowledge.

  Issue:  CAPTCHA activated but not showing up in front end, except for
  "Forgot password".

Environment:  My dev and prod environments are running Magento CE 2.1.3, theme is Ultimo Infortis.

Steps to activate CAPTCHA:

Backend Admin  ->   Stores -> Configuration -> Customer -> Customer Configuration -> Captcha:
1.1. Enabled Enable CAPTCHA on Storefront = "Yes"
1.2. Forms (selected all options: create user, login, forgot password, etc)
Reindexed via SSH
Backend Admin -> Flush cache

Test:  Go to the portal, try to open an account or do whatever and the CAPTCHA does not show, except for "Forgot Password".

Note: If CAPTCHA gets disabled for all in the configuration, "Forgot Password" keeps showing it.

Any guidance on where to look at or something that can help with the resolution will be appreciated.


texts: I want to update qty of cart items on click of + and - buttons . how to do this within magento , and outside magento, as I have implemented the same pop-up in wordpress , where I pull the cart items from magento. Here is the example of what I am trying to achieve. https://www.hitmeister.de/ (Cart Pop-up)


texts:
My steps:

1) Load my file slider.js to: app/design/frontend/Vendorname/default/web/js.

2) Create requirejs-config.js to: app/design/frontend/Vendorname/default

var config = {
        paths: {
            slider:        "js/slider"
        },
        shim: {
            slider: {
                deps: ["jquery"]
            }
        }
    };

3) rm -R pub/static/*

4) bin/magento setup:static-content:deploy

When I open site, slider.js is not loaded.
I need to call him, that he began to load?
I read a lot of Magento 2: Javascript Init Scripts, Use custom JavaScript.

Realy need help.


texts:
With this command:

sudo bin/magento setup:di:compile

I get this message:

  MiBPHP Fatal error:  Class 'Magento\Catalog\Model\Category\DataProvider' not found in /home .. ecc

There is a third party module that searches for this class. On

  /vendor/magento/module-catalog/Model/Category

I don't have this model.
I have Attribute.php, AttributeRepository.php, Tree.php but not DataProvider.php

Anyway, on github, on /app/code/Magento, I see this class:

https://github.com/magento/magento2/tree/develop/app/code/Magento/Catalog/Model/Category

why? My version is 2.0.12.


texts: Magento 2 - Checkout - Payment methods not visible

texts:
I'm trying to extend checkout page, I copied the

  checkout_index_index.xml

in my layout folder (vendor/theme/Magento_Checkout/layout) I change some thing in the file, now in the payment method I can't find method I set on the admin page. If I remove my custom layout file, the method come's back and they work's fine.

This'is my custom xml file (I remove jsLayout part I didn't modify it):

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/checkout.css" media="screen,projection" />
</head>
<body>
    <referenceContainer name="page.messages" remove="true"/>
    <move element="logo" destination="top-header" before="header-links"/>
    <referenceContainer name="newsletternewsletter" remove="true"/>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">Checkout</argument>
        </action>
    </referenceBlock>
    <referenceContainer name="content">
        <container name="checkout-container" as="checkout-container" htmlTag="div" htmlClass="row no-margin">
            <container name="checkout-center" as="checkout-center" htmlTag="div" htmlClass="col s12 m10 l10 offset-m1 offset-l1">
                <container name="checkout-border" as="checkout-border" htmlTag="div" htmlClass="dashboard-container">

                    <block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false">
                        <arguments>
                            <argument name="jsLayout" xsi:type="array">
                                <!-- NO CHANGE HERE -->
                            </argument>
                        </arguments>
                    </block>

                </container>
            </container>
        </container>
    </referenceContainer>
</body>


texts: Magento 2.3 Class VendoreName\ModuleName\Model\ResourceModel\CustomData\CollectionFactory does not exist

texts:
Object Type Error

As per the above link to overcome the Object Type Error I have to run the command php bin/magento s:d:c  after I run the command I got error like

.
Code

<?php
namespace Sathya\LoadProduct\Controller\Index;

use Magento\Framework\App\Action\Context; // constructor
use Magento\Framework\App\Action\Action; // Controller class

use Magento\Catalog\Model\Product; // Model Method
use Magento\Catalog\Api\ProductRepositoryInterface;  // Repository Method
use Magento\Catalog\Model\ProductFactory; // Factory Method
use Magento\Catalog\Model\ResourceModel\Product as ResourceProduct;
class Index extends Action
{
    protected  $productId = 500, $productModel, $_productFactory, $_productRepository,$ResourceProduct;
    public function __construct(Context $context, Product $productModel,ResourceProduct $ResourceProduct,ProductFactory $_productFactory, ProductRepositoryInterface $_productRepository)
    {
        parent::__construct($context);
        $this->productModel = $productModel;
        $this->ResourceProduct = $ResourceProduct;
        $this->_productFactory = $_productFactory;
        $this->_productRepository = $_productRepository;
        $this->getProductRepository();
        $this->getProductModel();
        $this->getProductFactory();
    }
    public function getProductModel()
    {
       $product = $this->productModel;
       $this->ResourceProduct->load($product,$this->productId);
        $product->setName("ram's phant");
        $this->ResourceProduct->save($product);

                     echo $product->getName()."
";
    }
    public function getProductFactory()
    {
        $product = $this->_productFactory->create();
        $this->ResourceProduct->load($product,$this->productId);
        $product->setName("ram's phant");
        $this->ResourceProduct->save($product);
        echo $product->getName()."
";
    }
    public function getProductRepository()
    {
        $product = $this->_productRepository->getById($this->productId);
        echo $product->getName()."
";

    }
    public function execute()   {    }
}


texts: Magento 1.7 Cash On Delivery & Bank Transfer: Sufficient replacement for 3rd party extensions?

texts:
Magento 1.7 brought two new core payment methods: Cash On Delivery and Bank Transfer. Until now, European stores that needed those methods had to use 3rd party extensions like Phoenix_BankPayment and Phoenix_CashOnDelivery.

Both are still maintained after the release of Magento 1.7, so obviously they did not become redundant.

I am wondering if I should give the new core methods a chance and would like to read some practical experiences: are they useful and sufficient?


texts: Add additional product to cart via an observer?

texts:
I have a checkbox in product view page and if it is checked and user clicks on "Add to Cart" I want to add additional product to the cart.

How to do this with an observer? Which event I need to watch?

EDIT: This seems to work

public function cartProductAddAfter()
{
    $product = Mage::getModel('catalog/product');
    $productId = $product->getIdBySku('X6020R-652');
    $qty = 1;
    $productToAdd = $product->load($productId);
    $cart = Mage::getSingleton('checkout/session')->getQuote();
    $cart->addProduct($productToAdd, $qty);
    $cart->save();
    Mage::getSingleton('core/session')->addSuccess('Product added to cart successfully.');
}


texts: How do I change the page titles in the head section for each page? I would like to show: 'page title | site name'


texts: I have a custom free shipping bar in minicart, and how can I move it to before "View And Edit Cart", hope anyone help me.


texts: Magento2 on upgrade not generating static assets

texts:
I made a copy of a website for upgrade from 2.2.1 to 2.2.6, but I think there is some small issue, which I am not able to figure out.

The static contents in the pub static folder are not getting generated, only the requirejs-config.js

When I my deploying static content with -f the assets are generated, but for the same file being there in the website I am getting a 404.

The .htacess file is there in the static folder.


texts:
I have created magento store for India and i have enabled FedEx shipping method from the system configuration but it will not showing in checkout shipping method section. my client has registered in FedEx with country india and i also have added the shipping method origin country india and city delhi but still it is not displaying on the checkout shipping method sections.

Can any one let me out from this issues?

I have found bellow error in my log file.

2015-06-24T07:57:02+00:00 ERR (3):
SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'AccountNumber' property in /home/buyboxon/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php:461
Stack trace:
#0 /home/buyboxon/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php(461): SoapClient->__call('getRates', Array)
#1 /home/buyboxon/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php(461): SoapClient->getRates(Array)
#2 /home/buyboxon/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php(487): Mage_Usa_Model_Shipping_Carrier_Fedex->_doRatesRequest('SMART_POST')
#3 /home/buyboxon/public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php(186): Mage_Usa_Model_Shipping_Carrier_Fedex->_getQuotes()
#4 /home/buyboxon/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(209): Mage_Usa_Model_Shipping_Carrier_Fedex->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#5 /home/buyboxon/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('fedex', Object(Mage_Shipping_Model_Rate_Request))
#6 /home/buyboxon/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(944): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#7 /home/buyboxon/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#8 /home/buyboxon/public_html/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(155): Mage_Sales_Model_Quote_Address->collectShippingRates()
#9 /home/buyboxon/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(1013): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#10 /home/buyboxon/public_html/app/code/core/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#11 /home/buyboxon/public_html/app/code/core/Mage/Checkout/Model/Cart.php(458): Mage_Sales_Model_Quote->collectTotals()
#12 /home/buyboxon/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(144): Mage_Checkout_Model_Cart->save()
#13 /home/buyboxon/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
#14 /home/buyboxon/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#15 /home/buyboxon/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /home/buyboxon/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 /home/buyboxon/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#18 /home/buyboxon/public_html/index.php(87): Mage::run('', 'store')
#19 {main}

Thanks in advance.


texts: Customize sticky behaviour of Cart Summary: Magento 2

texts:
I have a custom theme based on the Luma theme. And in this custom theme, I have made the header sticky.

By default, the Cart Summary is sticky as well. Now because my header is sticky as well, both of them are overlapped. This is how it looks.

How can I customize (or remove) this behaviour?

Can someone please point me to the right direction? Thanks.


texts:
I see that in Magento 2 all the xml (config, system, layout files, ...) files have a xsd associated for validation. This seams nice. Now you know what you are allowed to put in each file.

But I see that there are 2 validation schemas for each type of file.
Let's take system.xml for example.
The schema used inside the files is app/code/Magento/Backend/etc/system_file.xsd but there is also app/code/Magento/Backend/etc/system.xsd
I found a reference to system.xsd in Magento\Backend\Model\Config\SchemaLocator and it is declared as _schema and system_file.xsd is called _perFileSchema.

The difference between the 2 files are minor.
Just some label differences and on one tag there is a minoccurs="1" while on the other is minoccurs="0"

When is the _schema file used? In this example system.xsd.


texts: need help to revert back to default file permission magento2 aws

texts: After giving 777 permission website not working I think issue with file permission ,can you have a look ,let me know what to do next to bring back to default permission Installed on aws ,rds,


texts: Multi-Store with option for user to create store

texts:
I search for next option:

We want to develop main site, who give the option to his users (who registerd) to open sub-stores under our main store.

I saw the option of multi-store on Magento,Shopify, Opencart, Wordpress and so… but i dont sure if it answer my question.

If there is somthing that do what we serach – i will be happy if there is also ready theme for it.

Thanks


texts: onestepcheckout takes too long to place order in Magento 1.9.x

texts:
My store one-step check-out too much time in Magento 1.9.x version. The overall website works fine but the order place takes almost 10 minutes. Here is the website link: https://www.meldgaardpet.com/onestepcheckout/
Please help me to solve this issue, I've not much experience in Magento 1.
Thank you in advance for your help.
Faizan Roshan


texts:
I need to revert a site that has SUPEE-1533_EE_1.12_v1.patch installed to install 8788v2 patch. But the 1533 patch has been removed and I cant seem to find it anywhere.

How can I revert this patch to install 8788v2?

Thanks


texts: Magento two different subscription products same cart

texts:
I`m having an issue trying to add two different subscriptions in the same cart in my Magento 1.9.2.1 . But, i have product 1 and product 2. Also I have a product 3 ( that has them both- price 1 + price 2 ) And I was thinking to use Upsells product. So if customer adds Product 1 to his cart when he will proceed to checkout he will be asked if he wants product 2 in his cart as well. So i was thinking if he adds 2nd product to cart, then both will be removed from cart and 3d( that has them both) will be added instead. So I can use recurring for only one product. Any ideas? Maybe someone has a better way to handle this?

Thank you


texts: How to get shipping method title in sales_order_save event?

texts:
How can I get shippingMethod Title in mage/sales/model/Order.php, in function _beforeSave() ?
Actually I have to set label for Shipping Description.


texts: Rest Api to get Products how to pass filter "status" and "visibility"

texts:
$apiUrl = 'http://192.168.1.7/xxxx/api/rest';

...

$oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);

$resourceUrl = "$apiUrl/products?page=1&limit=5";

$oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json', 'Accept' => '*/*'));
$productsList = json_decode($oauthClient->getLastResponse());

print_r($productsList);
exit;

  I have getting list of product using rest api but i wants a filter
  with status=1 and visibility=4


texts:
I have this block at the bottom of cms pages that are created by bluefoot and when you click on the image it takes you to a long URL like if it was being searched for but if you click on "add to cart" it takes you directly to the PDP page. I would like to figure out how I can get the same results (go to PDP page) by clicking on the image. Not sure if this is a bug with bluefoot in 2.2.6 because I noticed on 2.3.1 it doesn't function like this, I believe the problem is because it's on a different store. But like I said on the newer versions (page builder) the link issue has been resolved.

On the bottom of the image, you can see the URL which is a long URL but it ends up going to a search results page and that particular product doesn't even populate. If they click on the image I would like to take them directly to the PDP. The add to cart button does just that.

I believe i have to edit one of these two files:

vendor/gene/bluefoot/view/frontend/templates/pagebuilder/blocks/core/ecommerce/single.phtml

 <?php // Product Image ?>
                        <a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
                            <?php echo $productImage->toHtml(); ?>

                            <?php
                            $_productNameStripped = $block->stripTags($_product->getName(), null, true);
                            ?>

                                <a class="product-item-link"
                                   href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>">
                                    <?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>

                            <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?>
                            <?php /* @escapeNotVerified */ echo $block->getProductPrice($_product) ?>
                            <?php echo $block->getProductDetailsHtml($_product); ?>

vendor/gene/bluefoot/Block/Entity/PageBuilder/Block/Catalog/Single.php

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace Gene\BlueFoot\Block\Entity\PageBuilder\Block\Catalog;

/**
 * Class Gene\BlueFoot\Block\Entity\PageBuilder\Block\Catalog\Single
 *
 *
 */
class Single extends AbstractCatalogBlock
{
    /**
     * Stop \Magento\Catalog\Block\Product\ListProduct::_beforeToHtml() running as
     * this is used for product listings/collections
     * @return null
     */
    protected function _beforeToHtml()
    {
        return null;
    }

    /**
     * Return the product
     *
     * @return bool|\Magento\Catalog\Api\Data\ProductInterface|null
     */
    public function getProduct()
    {
        /* @var $dataModel \Gene\BlueFoot\Model\Attribute\Data\Widget\Product */
        $dataModel = $this->getEntity()->getResource()->getAttribute('product_id')->getDataModel($this->getEntity());
        if ($dataModel instanceof \Gene\BlueFoot\Model\Attribute\Data\Widget\Product && method_exists($dataModel, 'getProduct')) {
            return $dataModel->getProduct();
        }
        return false;
    }
}

Lastly, I realize I should probably do a proper override but at this point, I'm just trying to get the link/image to go directly to the PDP. I've tried changing $_product->getProductUrl() to a variety of different things.. can someone tell me what I need to change the getProductURL to or if I need to change the getProduct method in the second file. Thanks in advance.


texts: How can I get Payments Details In an block below Order Summary in Checkout

texts: I know the way to get the block but not about the payment info.


texts: Magento2 - HDFC CC Avenue Payment Gateway

texts:
I am new to Magento and I was developing the site with HDFC Payment gateway installed the extension given by HDFC bank but I got error sometimes.

Sometimes It goes back to success page but sometimes It takes me to there has been an error processing your request page.

I haven't changed anything in Magento core or extension also, there is no log in exception.log.

Help me to solve thank you!


texts: Convert attribute type from Text to Dropdown

texts:
How can I convert a product attribute type from Text to Select in the Magento Backend. Is there any in-built functionality or we need to write custom code for that?

I already have attribute values assigned for many products, so don't want to lose that in this conversion.

Thanks


texts: Update product using rest api in magento 2

texts:
First thing I would like to share is that I am very new to magento. I am working on addition of products using rest api. I tried one product and it was created.

$headers = array('Authorization=> Bearer '. $token1);

    $requestUrl='http://localhost/development/index.php/rest/V1/products';

    //Use above token into header

    //Please note 24-MB01 is sku
    $ch = curl_init();
    $ch = curl_init($requestUrl);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    $post ='{
      "product": {
        "sku": "MY_SKU11",
        "name": "My Product223",
        "attribute_set_id": "4",
        "price": 110,
        "status": 1,
        "visibility": 4,
        "typeId": "simple",
        "weight": 10,
        "extensionAttributes": {
          "stockItem": {
            "stockId": 1,
            "qty": 20,
            "isInStock": true,
            "isQtyDecimal": false,
            "useConfigMinQty": true,
            "minQty": 0,
            "useConfigMinSaleQty": 0,
            "minSaleQty": 0,
            "useConfigMaxSaleQty": true,
            "maxSaleQty": 0,
            "useConfigBackorders": false,
            "backorders": 0,
            "useConfigNotifyStockQty": true,
            "notifyStockQty": 20,
            "useConfigQtyIncrements": false,
            "qtyIncrements": 0,
            "useConfigEnableQtyInc": false,
            "enableQtyIncrements": false,
            "useConfigManageStock": true,
            "manageStock": true,
            "lowStockDate": "string",
            "isDecimalDivided": true,
            "stockStatusChangedAuto": 0,
            "extensionAttributes": {}
          }
        },
        "options": [],
        "tierPrices": [],
        "customAttributes": [
        ]
      },
      "saveOptions": true
    }';

    $options = array(
        CURLOPT_URL=>$requestUrl,
        CURLOPT_VERBOSE=>0,
        CURLOPT_RETURNTRANSFER=>true,
        CURLOPT_USERAGENT=>"Mozilla/4.0 (compatible;)",
        CURLOPT_POST=>true,
        CURLOPT_POSTFIELDS=>$post,
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "PUT",
        CURLOPT_HTTPHEADER => array(
            "authorization: Bearer $token1",
            "content-type: application/json"
        ),

    );
    curl_setopt_array($ch, $options);
    $result = curl_exec($ch);
    $result=  json_decode($result);
    echo '</br>Response for add product<pre>';
    print_r($result);

The product is being created but when I am trying to update the same product and want to change price. I am unable to do so.

Can you guys help me out in this? Also is there any api documentation for this?

Thanks


texts: How to install grunt within docker container?

texts:
I finally was able to finish installing M2 enterprise cloud on docker for local dev, and the one final step is to install grunt so I can do some frontend work. I've been trying to wrap my head around how to go about this, but am a bit lost. I've installed grunt before with a sample, non-docker magento install, but since the docker images have the bare minimum necessary for each image I'm not sure how to do this exactly. Node and npm are not available on my php-fpm, and neither is apt-add-repository. Would I have to rebuild the entire project to install node on it during the ./vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="native" --php 7.2 --db 10.2 part, then follow steps like this?
$ sudo npm install -g grunt-cli
I have a feeling that the above isn't the proper way to do this on docker. I've seen some comments about magento having grunt support built in, but wasn't able to find enough about this to really be useful. Hopefully someone with more experience in this can chime in and point me in the right direction. Thanks!
Oh and I'm running 2.3.4 on Ubuntu 18.04 with php7.2 + mariadb 10.2 and am using docker-compose
Here are the containers I'm running:


texts: Magento 2: Update Stock programmatically and checking with isSalable()

texts:
I am trying to update the stock programmaticaly, but I'm having some issues.

What i want to do is before viewing a product on the frontend, check with an external web service to see if the product is in stock or not. and update the stock if it needs to be updated.

i succeeded in updating the stock, but for some reason the result is not shown on the frontend, only when you reload the page.

for example with an out of stock product:

$_product = $this->productRepository->getById($_productId);
$stockitem = $this->stockRegistry->getStockItem($_product->getId());
$stockitem->setQty(5);
$stockitem->setIsInStock(true)
$stockitem->save();
$this->stockRegistry->updateStockItemBySku($_product->getSku(), $stockitem);
$_product2 = $this->productRepository->getById($_productId);
$_product2->isSalable();

I just can't get this working.
But when i refresh the page, the change has been made. So i expect that the product is not being updated correctly. maybe because of cache or indexing, but i tried to reindex by code, and after that get the product from the product repository and still the assailable was the old setting.


texts: Magento2 get group product child that was added to basket

texts:
When adding a grouped product to the basket you actually add a child product not the parent product.

We are hooking into this event: checkout_cart_add_product_complete but the product returned by that is the grouped product which so it has no price and the data is incorrect for our purpose.

This is the Observer snippet...

public function execute(\Magento\Framework\Event\Observer $observer) {
        $this->intileryAnalyticsData->log('int_product_add_to_basket');
        $event = $observer->getEvent();
        $product = $event->getData('product');

        ...
}

How can I get a list of the children that were added to the basket? Just to be clear I want the list of simple products that were added to the basket.


texts: Inventory numbers wrong , Heavy Load under Sale

texts:
We experienced a heavy load sale where the site was as maximum load and we did around 2500 orders in a day. What seemed to of happened is that we sold 3 items when we only had 1.

We run some modules that cancel pending orders and add stock back into database.

The actual database was under heavy load , is it possible that inventory malfunctioned for around 7% of sales ?


texts: Remove price filter for specific category

texts:
I can remove all filters in category with this line:

<referenceContainer name="catalog.leftnav" remove="true" />

But, I need to remove only price filter for specific category. Can I do this with "Layout Update XML"?

This is a filter block structure:

I can use JS to find and remove price filter title or use css to remove last two elements for filter-options. But maybe there is another way to remove it completely via XML?

Thanks?


texts: Magento 2 EE : Override configure function(addbysku.js) of Magento_AdvancedCheckout module using mixins

texts:
In addbysku.js file, I want to override the configure function of Magento_AdvancedCheckout module using mixins in Magento Enterprise Edition.

And my js code is,

define([
/* eslint-disable strict */
    'prototype',
    'mage/translate',
    'Magento_Catalog/catalog/product/composite/configure'
], function () {
    var mixin = {
        configure: function (id, sku) {
            var productRow = $('sku_errors_table').select('div[id=sku_' + sku + ']')[0],
                noticeElement = productRow.select('.notice'),
                productQtyElement = productRow.up('tr').select('input[name=qty]')[0];

            if (typeof this.configurableItems[sku] === 'undefined') {
                this.configurableItems[sku] = id;
            }

            // Don't process configured element by addBySku() observer method (it won't be serialized by serialize())
            productConfigure.setConfirmCallback(this.listType, function () {
                var $qty;

                // It is vital to push string element, check this line in configure.js:
                // this.itemsFilter[listType].indexOf(itemId) != -1
                productConfigure.skuObject.configuredSkus.push(sku.toString());

                if (noticeElement.length) {
                    // Remove message saying product requires configuration
                    noticeElement[0].remove();
                }
                $qty = productConfigure.getCurrentConfirmedQtyElement();

                if ($qty) { // Product set does not have this
                    // Synchronize qtys between configure window and grid
                    productQtyElement.value = $qty.value;
                }
            });
            productConfigure.showItemConfiguration(this.listType, sku);
            productConfigure.setShowWindowCallback(this.listType, function () {
                // sync qty of grid and qty of popup
                var qty = productQtyElement.value,
                    formCurrentQty;

                if (qty && !isNaN(qty)) {
                    formCurrentQty = productConfigure.getCurrentFormQtyElement();

                    if (formCurrentQty) {
                        formCurrentQty.value = qty;
                    }
                }
            });
        },
    };
    return function (target) {
        return target.extend(mixin);
    };
});

This does not work for me.

Does anyone have an idea about how to override js using mixins?


texts: Why do bots hit report.php and captcha/refresh?

texts: Lately, some of our clients have had some trouble with report mail spam. When tracing this back, report.php and captcha/refresh were hit alot. My guess is that someone is trying to force errors on our environment (since there is a corebug that triggers an error when captcha/refresh does not receive a form id and report.php well.. yeah :)). Does anyone have an idea why people would try this and how to stop this? Requests have all been made trough Tor.


texts: Magento2 Products filter quantity_and_stock_status is not working

texts:
We are developing an iOS app for a Magento website using Magento2 rest apis. App is fetching and showing all products added to the magneto website. But some of the products are not being added to the customer/guest cart as they are unavailable as of now.

  In order to achieve this functionality we have added a new filter to show the products based on their stock and quantity's availability status.
  for this we have added "quantity_and_stock_status" filter to the products api, which is not working.

Here are the details of the api we have implemented for filtration of products:

func fetchItems(field:String?, value:String?) {
    //Check for internet connection.
    guard self.isNetworkAvailable() == true else {
        return
    }
    self.showProgressHUD()

    var productSearchAPI = API.host +  "/rest/V1/products?"
    if let fieldName = field, let fieldValue = value {
        productSearchAPI += "searchCriteria[filter_groups][0][filters][0][field]=\(fieldName)"
        productSearchAPI += "&searchCriteria[filter_groups][0][filters][0][value]=\(fieldValue)"
        productSearchAPI += "&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&"
    }

    productSearchAPI += "searchCriteria[filter_groups][0][filters][1][field]=status"
    productSearchAPI += "&searchCriteria[filter_groups][0][filters][1][value]=1"
    productSearchAPI += "&searchCriteria[filter_groups][0][filters][1][condition_type]=eq&"

    /*productSearchAPI += "searchCriteria[filter_groups][0][filters][2][field]=quantity_and_stock_status"
    productSearchAPI += "&searchCriteria[filter_groups][0][filters][2][value]=0"
    productSearchAPI += "&searchCriteria[filter_groups][0][filters][2][condition_type]=gt&"*/

    productSearchAPI += "searchCriteria[pageSize]=\(pageSize)"
    productSearchAPI += "&searchCriteria[currentPage]=\(currentPage)"

    Alamofire.request(productSearchAPI, method: .get, parameters: nil, encoding: URLEncoding.default, headers: ["Authorization":API.key]).responseJSON { response in

        self.hideProgressHUD()
        guard let JSON = response.result.value as? [String:AnyObject], let items = JSON["items"] as? [[String:AnyObject]], let pages = JSON["total_count"] as? Int else {
            return
        }
        if self.currentPage == 1 {
            self.items = items
        } else {
            self.items?.append(contentsOf: items)
        }
        self.totalPages = pages
        self.collectionView.reloadData()
    }
}

Can you please help us by pointing what is wrong with our product list filter's implementation?


texts: How to get description of related products on product page in magento?

texts:
I am using magento 1.7 and i need to display description of related products on product page. I am getting name ,image and URL of related products through related.phtml but not getting description.

And i also want add to cart button there which will add that related product to the cart.

Thanks in advance,


texts: category product collection from the current category to parent category

texts:
I would like to change the category product collection from the current category to the parent category?

I have created a custom category in which I would like to load the collection of the parent category


texts:
The code:

<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />

Does not appear on the html (firebug). When I change the name to another it appears. Is the meta keywords correct to be hided ?


texts: How to get validator error or cannot add product to cart

texts:
I'm using Magento 1.9 (CE) and I cant add the product to cart due to validator error. There's no message, it just returns false. If I'll try to submit the form with product manually it'll add to cart.

hidden input with form key exists on the product page.

the issue is not with cookies.


texts:
Trying to understand on a lower level how Magento deals with categories and products and relations among them.
Going on the admin>catalog>categories I see a tree of categories. Each of the nodes has an ID and a number associate with it, which should mean products belonging to the category.
Is that exclusively stored in the catalog_category_product?
When I query some categories from the catalog_category_product table, I get a value that sometimes is different from the one showed on the parenthesis of the category.
How's that possible?
In the same way, when I select a category and check products in a category, also here I can see differences.
Sometimes products are less than the ones indicated in the parenthesis and this happens to terminal nodes as well.
I suspect other tables are involved but I didn't yet figure it out.


texts: Magento 2 - Need a multi-select filter in place of dropdown in admin grid

texts:
I have added a new category filter to product grid following a nice tutorial is given here - https://chillydraji.wordpress.com/2016/11/29/add-category-filter-to-product-grid-in-magento2/

Now I want to change my category filter to multiple-select box from a single select dropdown so that I can apply multiple category filters at once. Can anyone please help me to suggest what should I change here to get the multi-select box for category filter.