texts:
Is there a limit on API calls using Magento's SOAP API (V1)? The product page for a store I'm working on requires several calls to the "cataloginventory_stock_item.list" method, once for every "simple product" associated with the "configurable product." This method returns an array of product details, but only up to five calls, after which, I run into an error.

For example: Products (by id) 18730 through 18741 are all simple products that represent different options for the configurable product of id 18742. The following code loops through these ids and performs the aforementioned API call, using the id as an argument.

$client  = new SoapClient("http://WEBSITE.com/magento/api/soap/?wsdl");
$session = $client->login(USERNAME, PASSWORD);

for($id = 18730; $id < 18742; $id++){
    $result = $client->call($session, 'cataloginventory_stock_item.list', $id);
    echo "<p>" . json_encode($result) . "</p>";
}

The result is as follows:

[{"product_id":"18730","sku":"FF016077-M-F. Grey","qty":"3.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18731","sku":"FF016077-M-P.Green","qty":"1.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18732","sku":"FF016077-M-U. Blue","qty":"2.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18733","sku":"FF016077-L-F. Grey","qty":"5.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18734","sku":"FF016077-L-P.Green","qty":"2.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

Fatal error: Uncaught SoapFault exception: [HTTP] Forbidden

I know that this error is triggered by the fifth iteration, not by any property of the product of id 18735, because if I initialize the for-loop at 18735, I get the following:

[{"product_id":"18735","sku":"FF016077-L-U. Blue","qty":"3.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18736","sku":"FF016077-XL-F. Grey","qty":"4.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18737","sku":"FF016077-XL-P.Green","qty":"1.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18738","sku":"FF016077-XL-U. Blue","qty":"3.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

[{"product_id":"18739","sku":"FF016077-XXL-F. Grey","qty":"1.0000","is_in_stock":"1","use_config_manage_stock":"1","manage_stock":1,"min_sale_qty":1,"is_qty_decimal":"0","enable_qty_increments":false,"qty_increments":false}]

Fatal error: Uncaught SoapFault exception: [HTTP] Forbidden

This is also a very recent problem. Up until only a few days ago, I had not encountered this error. Perhaps a patch enforced a limit on API calls? If so, is there a way to fix this? Or is there a better API method for retrieving a configurable product's associated simple products?


texts: Magento native file PHP function - public function getItemOptionsValue(): float

texts:
/vendor/magento/module-catalog/Pricing/Price/ConfiguredOptions.php

This is file in magento native version 2.2.4

/**
     * Get value of configured options.
     *
     * @param float $basePrice
     * @param ItemInterface $item
     * @return float
     */
    public function getItemOptionsValue(float $basePrice, ItemInterface $item): float
    {
        $product = $item->getProduct();
        $value = 0.;
        $optionIds = $item->getOptionByCode('option_ids');
        if ($optionIds) {
            foreach (explode(',', $optionIds->getValue()) as $optionId) {
                $option = $product->getOptionById($optionId);
                if ($option) {
                    $itemOption = $item->getOptionByCode('option_' . $option->getId());
                    /** @var $group \Magento\Catalog\Model\Product\Option\Type\DefaultType */
                    $group = $option->groupFactory($option->getType())
                        ->setOption($option)
                        ->setConfigurationItem($item)
                        ->setConfigurationItemOption($itemOption);
                    $value += $group->getOptionPrice($itemOption->getValue(), $basePrice);
                }
            }
        }
        return $value;
    }

My question is what does this mean in PHP because its displaying error in netbeans [see attached screen shot]

public function getItemOptionsValue(float $basePrice, ItemInterface $item): float
{
...
}


texts: Magento 1.9 - 2 store, 1 product - different URL

texts:
I had Magento 1.9 website which runs with default store only.

Now I have created 1 more store for USA customers with currency $.

Now the issue is why every product have 2 URLs, different URL for both stores. There is an issue and duplicate content issue with SEO, So I want only 1 URL for both stores.

Ex:
Product: XYZ
Store India URL: xyz.html with price in INR
Store USA URL: xyz.html with price in $

I have used one extension which redirects me to the specific store based on user IP.

Thank you.


texts: Magento2 - catalog product listing collection sort by price with dynamic price calculation

texts:
product price is calculated dynamically based on certain conditions. while sorting with price it takes only default price not dynamically calculated price. the same issue with the price filter.

I can able to set the calculated price for product using event catalog_block_product_list_collection observer but not able to get products ordered by dynamic price.

<event name="catalog_block_product_list_collection">
    <observer name="product_price_change" instance="[vendor]\[module]\Observer\ProductCollectionDynamicPrice" shared="false" />
</event>

Observer - [vendor][module]\Observer\ProductCollectionDynamicPrice

<?php
namespace [vendor]\[module]\Observer;

use Magento\Framework\Event\ObserverInterface;

class ProductCollectionDynamicPrice implements ObserverInterface
{
    /**
     * set dynamic price
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return $this
    */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
       $productCollection = $observer->getEvent()->getCollection();
       if ($productCollection instanceof \Magento\Framework\Data\Collection) {
          $productCollection->load();
          $this->calculatePrice($productCollection);
       }

       return $this;
    }

    /**
     * set dynamic calculated price to product collection
     *
     * @param ProductCollection $collection
     * @return $this
    */
    public function calculatePrice($collection) {

     foreach ($collection as $key => $item) {
        $price = 100;  // here my cuustom logic to calculate dynamic price based on conditions
        $item->setMinPrice($price);
     }

     return $collection;

   }
 }

If I echoing min_price then able to get updated min_price but not able to get correct product orders collection sort by price.

Please anyone can help for the issue?


texts:
i want add phtml page block before additional block on product detail page

i want to do it vai catalog > catagory > custom design update (apply to products) i am able to add some custom block which show content from some file like path/abc.phtml

i am able to override block using code like below there

<reference name="product.info.media">
      <action method="setTemplate">
            <template>smartwave/zoom/product/view/media_bundled.phtml</template>
      </action>
</reference>

can u guide me xml code needed to do that


texts: How disable maintenance mode from files in magento2?

texts: I don't have ssh access to one of my website. I have only FTP details . so how i can disable Mode using FTP.


texts:
I am getting the following error while completing the second step (billing address) on checkout page:

"Privacy" is a required value.

I cannot see any Privacy field.

could you please suggest me what I may have messed up.

ADD: I have also checked HTML source code for the checkout page but cannot find any reference to Privacy on the page.

Just found that I get this message in the new account registration form as well. I am also not able to see the agree to terms and conditions checkbox on registration page. It seems this is disabled some how.


texts: Magento 2 - How to add admin username in order comments on admin action

texts:
I need to add admin username in order comment history whenever I create

invoice
shipment
and On Cancel order.


texts: How to create a simple Dynamic rows in admin using Data Provider?

texts: Can anyone please show me an example of creating dynamic rows using "Data Provider" in Magento 2, like the Tire price creations in the screenshot


texts: How can I translate an extension (module) ? I tried to create the i18n folder and create the it_IT.csv file. But it does not work, how can I do translation?


texts: cron.php run through server not with commandline

texts:
https://www.templatemonster.com/help/magento-setting-up-the-cronjob-using-cpanel.html
My cron.php is in my pub folder
http://www..com/pub/cron.php
Do I have to edit this

I have tried to connect through ssh via putty but putty is giving me error
Any help will be appreciated
Thanks


texts: Magento 2: Add a custom link in checkout

texts: I want to add a link (Continue Shopping) that takes me to the homepage, on the checkout step myshop.com/checkout refer to image attached.


texts: How to update Qty on product save action?

texts:
I'm trying to update the StockData in catalog_product_save_before observer and not having any luck.

I can get the stock data like this

$_newProduct = $observer->getProduct();
$_newStock = $_newProduct->getStockData();
$PostQty = $_newStock['qty'];

I can update anything that isn't stock data like this

$_newProduct->setData('ebay_qty', $eBayQty);

I need to update the Qty based on other attributes. I have tried all these with no luck

$_newStock['qty'] = $NewQty; // Doesn't work
$_newStock->setData('qty', $NewQty); // Doesn't work
$_newStock->setQty($NewQty); // Doesn't work

I have also tried this

$_newStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_newProduct);
$_newStock->setQty($PossibleQty);
$_newStock->save();


texts:
below is my code, i have array of images i want to set first image of array as main , base and thumb image but it does not works .also just 3 images shows in gallery instead of 4

issue

<?php
require_once 'app/Mage.php';
Mage::app();
Mage::app()->getStore()->setId(1);

$importDir = 'bulkimages/101/';

$productsData = array('1.jpg','2.jpg','3.jpg','4.jpg');

$k=0;
foreach($productsData as $fileName){
    $k++;
    $productSKU = '111';
    $ourProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',$productSKU);
    $filePath = $importDir.$fileName;
    if (file_exists($filePath)) {
        echo $filePath;

            $ourProduct->addImageToMediaGallery($filePath, array('image', 'small_image', 'thumbnail'), false, false);

        $ourProduct->save();
        echo "done ";
    } else {
        echo $productSKU . " not done";
        echo "<br>";
    }
}

?>


texts: Magento 2 : How to change grand total in shopping cart page

texts:
I want to change grand total i.e of on shopping cart page.
I don't want to show any shipping or taxation on cart page all must be on checkout page only.

I tried with changing vendor\magento\module-checkout\view\frontend\web\js\model\totals.js like

if(i == 4){
    this.totals().total_segments[i].value = this.totals().total_segments[0].value;
    var total = this.totals().total_segments[i];
}

and it works for me but if I made any changes in it then it will reflect on chcekout page also I want it on shopping cart page only.

Can any one please suggest how can I achieve this.


texts: Magento 2.4 : I installed elastic search, but when i run start command to run elastic search it will give error

texts:
I installed elastic search, but when i run start command to run elastic search it will give error, and there is no error in log files in /var/log/elasticsearch

I am adding log files also, and i am using aws ubuntu 20.04 t2.micro


texts: Retail Kit - WebPOS cannot check out products

texts:
I've been exploring Magento at work recently and I've come across a roadblock.

WebPOS would tell me to

  "Please check your network connection. Or disable checkout online to
  continue"

when I'm checking out in online mode and when I try checking out in offline mode it checks out and prints the receipt but fails to sync 15 seconds later and sends 2 object errors.

After checkout @ offline mode

Offline Mode errors

Any help would be appreciated, thanks.

EDIT: It seems like the only choice I have in the Location of POS is "Default Location" even after I add new warehouses in the Inventory Management module. Is it possible that it has something to do with the integration between the two modules?


texts: Magento 2 custom address fields not saving to database from checkout

texts:
Through a setup script I created two new customer address fields for Magento 2. These field show up nicely in the backend and checkout. But, the values are not send from checkout to the api. Now the fields are not saved into the database.

Also, when editing the order address in the backend the values aren't stored. The values are only stored when editing the customer address through the customer itself.

What am I missing!? The Magento docs about adding a shipping field aren't helping me...


texts: Why does the Product\Collection not respect the page-number and page-size attributes?

texts:
I'm trying to get a list of all the products in the store using the product-collections but it doesn't respect the page and page-size params. I'm using the sample data and have 174 products in my store but irrespective of the page number and size supplied when querying the collection:

/** @var Store $store */
$store = $this->_storeManager->getStore(true);
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
$collection = $this->getCollection($store);
$collection = $collection->addAttributeToSelect('*');

$collection = $collection->setCurPage(100);
$collection = $collection->setPageSize(1000);
$collection = $collection->load();

var_dump($collection->getSize());
//var_dump($collection->count());
//var_dump(count($collection->getData()));

I've tried to output the size of the collection after querying it but the number of results are incorrect.


texts:
Why is my custom sales_order_payment_place_end event not working.

If i enable this in my events.xml I cannot place the order.

Page redirects from:

Checkout/cart/ -> Payment page -> mini cart page. (Does not go to success page).

If i comment out the below it works fine!!

Has any1 faced the similar problem for this event?

My events.xml

<event name="sales_order_payment_place_end">
    <observer name="sales_order_payment_place_end_handler" instance="Vendor\Module\Observer\SyncProductPaymentComplete"/>
</event>

What is the problem here.

The error in browser console:

 function makeError(id, msg, err, requireModules) {
    var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
    e.requireType = id;
    e.requireModules = requireModules;
    if (err) {
        e.originalError = err;
    }
    return e;
}


texts: Magento 2: Auto disable status after generate new product

texts:
We create product configurations, after that we want generate new variants. When click generate button, product generate but status auto enable.
How to auto disable product depends on stock or quantity?


texts:
I'm aware that this probably isn't the first time this question has been answered, but I'm wondering what is the best approach to keeping my magento 2.3.1 install secure: Should I update to 2.3.2 or install patches?

How risky is it to update Magento between minor versions?

Thanks!


texts: How to hide categories with no active products?

texts:
Is there a way to hide categories that don't have active products?

Or, even better, only show categories that have active products and stock.


texts: How to override a method of abstract file of invoice pdf

texts:
I want to override a method insert Totals of this file :-  app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php

How can I do that? Can anyone please guide?

I saw this post : Changing PDF appearance  which is quite good but still can't understand which file to make, where to make etc... We have our custom module in which we can do the stuff but I can not understand which file to make & where to put to override abstract class method.

Can anyone please guide step by step implementation of this?

Here is the further update :-
What I tried is : in my config.xml file I put this :-

<sales>
<rewrite><order_pdf_invoice>Promotion_Multidiscount_Model_Sales_Order_Pdf_Invoice</order_pdf_invoice>
</rewrite>
</sales>

And I copied code/core/Mage/Sales/Model/Order/Pdf/Invoice.php in my module's folder that is code/local/Promotion/Multidiscount/Model/Sales/Order/Pdf/Invoice.php & I modified that particular function only & kept rest of the functions as it is but now this error coming when I go to Invoice of any order & click Print button.

Error :-

Fatal error: Uncaught Error: Call to a member function getPdf() on boolean in /opt/lampp/htdocs/magento_store/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php:119 Stack trace: #0 /opt/lampp/htdocs/magento_store/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489): Mage_Adminhtml_Controller_Sales_Invoice->printAction() #1 /opt/lampp/htdocs/magento_store/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_InvoiceController->printAction() #2 /opt/lampp/htdocs/magento_store/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('print') #3 /opt/lampp/htdocs/magento_store/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #4 /opt/lampp/htdocs/magento_store/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch() #5 /opt/lampp/htdocs/magento_store/app/Mage.php(683): Mage in /opt/lampp/htdocs/magento_store/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php on line 119

Url is like this :-
http://localhost/magento_store/index.php/admin/sales_order_invoice/print/invoice_id/43/key/be7b6b59159f5523398350f73d1236c2/

Thank you.


texts: After Upgrade Magento 2.3.2 to 2.3.3 getting error

texts:
Fatal error: Uncaught Error: Call to a member function addAttributeToSort() on null in /app/code/Sm/FilterProducts/Block/FilterProducts.php:394 Stack trace: #0 /app/code/Sm/FilterProducts/Block/FilterProducts.php(193): Sm\FilterProducts\Block\FilterProducts->_newProducts() #1 /app/code/Sm/FilterProducts/Block/FilterProducts.php(442): Sm\FilterProducts\Block\FilterProducts->_getProducts() #2 /generated/code/Sm/FilterProducts/Block/FilterProducts/Interceptor.php(102): Sm\FilterProducts\Block\FilterProducts->getLoadedProductCollection() #3 /app/design/frontend/Sm/market/Sm_FilterProducts/templates/default-sidebar.phtml(15): Sm\FilterProducts\Block\FilterProducts\Interceptor->getLoadedProductCollection() #4 /vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/www/onlyt...') #5 /vendor/ in /app/code/Sm/FilterProducts/Block/FilterProducts.php on line 394

my collection code as :

$collection->addMinimalPrice()
            ->addFinalPrice()
            ->addTaxPercents()
            ->addAttributeToSelect($this->_catalogConfig->getProductAttributes())
            ->addUrlRewrite()
            ->setStoreId($this->_storeId)
            ->addAttributeToFilter('is_saleable', [1], 'left')
            ->addAttributeToSort('created_at','DESC');


texts: Magento show a products promotion under the product name on the product listing page

texts:
I have seen this feature on several websites, and included in a few expensive extensions, however I am wondering if its as simple as a few code changes on catalog/product/list.phtml. Any help is appreciated.

Example under each product that is included in said promotion

  On The Byas Axer Henley Crew T-Shirt

  $19.99

  Buy one Get one Free


texts: Magento Create Order programmatically with status complete and payment

texts:
I am providing web services of Magento to an Android app and wanted to create order with payment information and status completed.

My app will give information of sold product with payment information then I have to create sales orders immediately in Magento with complete status and payment information.

http://www.magentocommerce.com/boards/viewthread/28426/

I followed this link and various other links but it creates order with status pending and payment is due.

I have to create sales order with complete status and with done payment.

The order shows like:

Grand Total     $0.01
**Total Paid    $0.00**
Total Refunded  $0.00
Total Due   $0.01
Subtotal    $0.01

I need total paid =$0.01;


texts: Layered Navigation On product Page Not Working because of URL

texts:
i'm using layered navigation in product view page.

On click on any filter, it's simply appending those filter at the end of current url

Example,

This is my current product page url,

http://host.com/mento17/index.php/category/product1.html

On same product page if i filter by price, i'm redirecing to

http://host.com/mento17/lovablenew/index.php/category/product1.html&price=100-500

I should go to category listing page,

http://host.com/mento17/index.php/category.html&price=100-500

getUrl() is the function which is generating url from /app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php

It's mentioned like below,

public function getUrl()
    {
        $query = array(
            $this->getFilter()->getRequestVar()=>$this->getValue(),
            Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
        );
        return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
    }

Above function simply appending filter at the end of current url. This works fine in category page but not in product page.

Is there any way to make it work in product page by altering url ?


texts: Magento: How to position Newsletter box above footer wrapper?

texts: I am new to Magento and just starting to create own package and theme. What is a good practice to do it?


texts: Move top links to left column with CSS only

texts:
Is it possible to move the top links in user menu from the right hand column, to the left column purely with CSS?

My theme has it by default in the right column, but the design needs it to be in the left hand column for symetry. The basket and search bar need to remain in the top right section. Only the top links moving to the left column.

My CSS knowledge is pretty minimal, I've tried the below:

    .header-regular .right-column .user-menu .top-links,
    .header-regular .right-column .user-menu .top-links ul {
        position: relative;
    }

But it only moves the top links around in the right column, tried using float: left; too, but no movement.

Screenshot of what I mean:

http://imgur.com/aNWK5gC

Any help would be appreciated.


texts: Backend: Reason for duplicate? "Default Email Domain" configuration option

texts:
In the Magento backend I can set the email addresses used to contact customers
in the following place: System -> Configuration -> GENERAL -> Store Email Addresses.
How these configured email addresses are used can be further configured under
ystem -> Configuration -> SALES -> Sales Emails, for instance, although the
defaults are generally fine.

What I don't understand is, under System -> Configuration -> CUSTOMERS -> Customer Configuration -> Create New Account Options, there is an entry under Create New Account Options entitled:

"Default Email Domain"

What is this? After all, the store has its own emails as pointed out above, and each
registering customer will have their own email, so whose default is this? After all,
as far as I understand it, no store is going to offer customers email adresses under
an "email domain", so what the heck is this entry all about? I'm puzzled.

Thanks a lot.


texts:
Inside our template/catalog/product/list.php file I want to load ChildHtml.

Inside list.php I got this line:

   <?php echo $this->getChildHtml('beknopte_specificaties_new'); ?>

What do I need to place inside our local.xml file?

External .php file:

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
    $theme = $this->helper('ultimo');
?>

<?php $yourCatIds = array(27,233,234,235);
$productCats = $_product->getAvailableInCategories();

if (count(array_intersect($yourCatIds,$productCats))) {

    if($_product->getData('i_display_diagonal_944_1')) :
    echo '
' . $_product->getResource()->getAttribute('i_display_diagonal_944_1')->getFrontendLabel() . '';
    echo '' . $_product->getAttributeText('i_display_diagonal_944_1') . '
';
    endif;

}
?>

I tried this but that does not work:

<catalog_category_layered>
<reference name="product_list">
<block type="catalog/product_view" name="beknopte_specificaties_new" as="beknopte_specificaties_new" template="catalog/product/view/beknoptespecs.phtml"/>
</reference>
</catalog_category_layered>


texts: Order accept/cancelled and print recipt via GPRS printer from magento2 store?

texts:
I want a mechanism in which when customer order on my website, shopkeeper at shop gets order request on his GPRS machine, shopkeeper can accept or canceled request from GPRS machine and it will update order status on my web-store as well as when shopkeeper gets order request GPRS machine prints receipt of order for packaging.

I purchase this E_POS GPRS machine for this job (http://www.kmychina.com.cn/en/product/detail.asp?id=940)

as this product owner uploaded video on YouTube how it works its exactly same what I wants to do  (https://www.youtube.com/watch?v=G5dPZ2kfacU)

company provides me some necessary documentation about how do I connect to my mailing server , but I'm getting confuse how it connects to my store and change order statuses ? I also contacted them but they ain't replying yet ,that's why I'm asking here for little help .

  Do I need any kind of API for connection this machine to my store for
  changing order statuses and printing order receipts? along with some CRON job code for checking upcoming orders list ? I need help in code  Please
  elaborate :)


texts: Does anyone know how to print orders before they are invoiced. We are migrating from volusion. in volusion you can select a batch and print it. From there we check stock then proceed to process and invoice the order.


texts:
I'm stuck trying to exclude the shipping cost from the order-totals table in the invoice email.

At the moment, the invoice email looks like this: (I included a little translation for the most important fields)

As you can see: the grand total (15.80€) includes the shipping tax (6.20€).

Is it possible (and if, how) to change the grand total to exclude the shipping cost?

I've made a small mockup below:

Do I need to edit template files? Or should I target the GrandTotal calculation in the model?

I'm using Magento 1.8.

I very much appreciate any help regarding this issue.  :)


texts: Dynamically add year variable to meta title / description in Magento 2

texts:
I am trying to automatically add the current year to the meta title and description in for example category-pages. I want to achieve something like this:

Meta title: "The best category items for {{year}}" >> "The best category items for 2019"

What would be the easiest way to do this?


texts: Magento : Why Use Model and Not Write Straight in Controller?

texts: If I have simple module, is there any reason why I should ever use Model and not just write everything in controller? Are there any limitations to this?


texts: Homepage became white screen after successful data Migration with no error log

texts:
Problem: White screen after data Migration.

Precondition:

I Migrate from Magento 1.9.1 to Magento 2.1.9 with lots of custom
extensions and customization. So I skip custom code & database tables migration .
I create custom theme and used lots of Magento 2 extension to
a fulfilled requirement like banners, testimonials, blogs.. etc

I successfully did data migration from Magento1.9.1 to 2.1.9. Links how I did Migration using Data-migration-tools (customers,reviews,orders,catalog,settings)
I tried both with settings and without settings. After successful migration, my home page became white with No error log

What I tried many times upgrade, compile code clear static content.

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy

I enable developer mode and set profiler also

bin/magento setup:mode:set developer

SetEnv MAGE_PROFILER "html"

when I see source code nothing wrong, means complete homepage code with inspect element/console.

How should I debug Now? any suggestion


texts:
php bin/magento setup:upgrade

  PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted
  (tried to alloc ate 32768 bytes) in
  C:\xampp\htdocs\MagentoEbenezer\vendor\donatj\phpuseragentpa
  rser\src\UserAgentParser.php on line 128

  Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to
  allocate 3 2768 bytes) in
  C:\xampp\htdocs\MagentoEbenezer\vendor\donatj\phpuseragentparser\
  src\UserAgentParser.php on line 128

please can i help me to solve this


texts: "Zend_Json_Exception Decoding Failed: syntax error" on module:enabled

texts:
When I try to enable my module with bin/magento module:enabled I am getting an error in console:

  Zend_Json_Exception Decoding Failed: Syntax error

How can I fix this? When I enabled the same module in local server everything worked fine.


texts: Magento catalog price rule grid not working

texts:
I'm  unable to create catalog price rule and existing price rule too is not working in site. In console, I could see below error.

uncaught TypeError: Cannot read property 'select' of undefined
at g.bindFieldsChange (grid.min.js:20)
at g.initGrid (grid.min.js:7)
at g.initialize (grid.min.js:3)
at new g (legacy-build.min.js:1)
at (index):160
at Object.execCb (39daca1563231596c195ad22ae44a0ec.min.js:112)
at Module.check (39daca1563231596c195ad22ae44a0ec.min.js:56)
at Module. (39daca1563231596c195ad22ae44a0ec.min.js:72)
at 39daca1563231596c195ad22ae44a0ec.min.js:11
at 39daca1563231596c195ad22ae44a0ec.min.js:74

I tried redeploying, as it seems to be js issue.
I ensure no duplicate catalog rules in DB

Can some help me to identify issue and suggest for fix?.


texts: Magento 2.1.3: Undefined offset error when exporting all customers via csv

texts:
I tried to export all the customers in the form of csv from a Magento 2.1.3 site.

But after I clicked export this will be the outcome:

  1 exception(s):
  Exception #0 (Exception): Notice: Undefined offset: 0 in /var/www/DEVELOPMENT/html/vendor/magento/module-customer/Ui/Component/DataProvider/Document.php on line 135

Any ideas what's wrong with this one?

Thanks!


texts: How to redirect product link to a store view?

texts:
Just checked in my Google Webmaster Tools and found that there were a large amount of Not found products.

I am running a multilingual store with 2 languages.

Google has correctly identified product links, but they are missing the language identifier.

Example:

Product X has a URL KEY product-xyz.html

Google has indexed product-xyz.html and not /eng/product-xyz.html

How do I create a redirect for the URL key to automatically add /eng/ when a products URL key is used?


texts: Magento 2.2.3 Install in Subdirectory, admin not loading and redirect to home page

texts: After installing Magento 2.2.3 to Magento subdirectory, I am unable to open Magento backend. Frontend is working properly but whenever I am trying to open backend it will automatically rediects me to Homepage.


texts:
I have added a extra column in sales_flat_quote_item table. Populating the column during checkout works fine. But showing the values of the extra column on the order details page in admin does not work. I also would like to show the extra column in the order confirmation email.

can you please tell me how to get the data from the column in these places?


texts: Magento 2.1 Ui Component form field Token input

texts:
I want to add tags in an input field , in a similar fashion as it is done in product form to add catageories - which is show in the image below.

This much task I have achieved by adding field component in the Custom Ui form

<field name="parent">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Tags</item>
                <item name="componentType" xsi:type="string">field</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="component" xsi:type="string">Magento_Catalog/js/components/new-category</item>
                <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                <item name="dataScope" xsi:type="string">data.parent</item>
                <item name="filterOptions" xsi:type="boolean">true</item>
                <item name="showCheckbox" xsi:type="boolean">false</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
                <item name="multiple" xsi:type="boolean">true</item>
                <item name="levelsVisibility" xsi:type="number">1</item>
                <item name="sortOrder" xsi:type="number">20</item>
                <item name="required" xsi:type="boolean">true</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
                <item name="listens" xsi:type="array">
                    <item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
                </item>
            </item>
        </argument>
    </field>

But this does not meet my requirement. I do not need the drop down and the options - I just wanted to add the tags in the input field like Tag1, Tag2 ,Tag 3 ... Can any one guide where we could make the possible changes to achieve this task.


texts: How to disable welcome email in magento2.2

texts: I want to know how to create a custom module to disable this welcome message.


texts:
So far I know two ways of changing the column count.

Option 1.  Hard Coding it:

Change:

<?php $_columnCount = $this->getColumnCount(); ?>

To:

<?php $_columnCount = 4 ?>  //or whatever number you desire

Option 2.  Under Manage Categories in the Backend under the Custom Design Tab:

    <reference name="product_list">
        <action method="setColumnCount"><count>4</count></action>
    </reference>

Are both methods equally good? What is the benefit to not hard coding the column count in? I imagine one benefit would be that different categories could get different column counts.

Is there a better way? Is there anything I am missing? They both seem pretty hard coded to me.


texts: Magento 2: Create Dropdown InstallData Attribute Programmaticaly

texts:
I want to create InstallData & UpgradeData for attribute product and automatic added to All AttributeSet.

I've created the dropdown attribute product like this below.


texts:
I'm developing a custom module. The module has to respond to requests on domain.com/file.txt.

How can I configure a router for this path in etc/config.xml?

This is different from the usual router configuration XML, because there is no frontname and no controller in the path.


texts: Error while installing sample data in magento 2.4.1

texts:
Recently I have installed the Magento 2.4.1 community edition in Ubuntu 20.04, Installation went correct and while I try to set sample data I got the below error
"Unable to apply data patch Magento\CatalogRuleSampleData\Setup\Patch\Data\InstallCatalogRuleSampleData for module Magento_CatalogRuleSampleData. Original exception message: Rolled back transaction has not been completed correctly."
I have searched about this issue and tried all the solution which have been provided
Tried solutions:

Switch to developer mode before installing sample data
Using MySQL 5.7
Remove the sample data and rerun again
Remove the corn job before installing the sample data
but none of the solutions worked for me. as a temporary fix, I have disabled the Magento_CatalogRuleSampleData Magento_SalesRuleSampleData and using the local site.

Environment details:
I am using
ubuntu 20.04
PHP 7.3.25
apache 2.4.46
MYSQL 5.7.32
elastic search 7.6.0
Magento 2.4.1
Anybody, please suggest a proper fix for this issue.


texts: Limiting the size of system.log and exception.log files

texts:
I was trying to troubleshoot a problem on my site and went to look at the system.log file and it was over 1GB.

The exception.log wasn't as big but it got me thinking:

How do you limit the size of the logging files for Magento?


texts: How to override Magento\Cybersource\Gateway\Request\SilentOrder\TransactionDataBuilder class?

texts:
I want to pass the custom REFERENCE_NUMBER to CyberSource So, I tried to override the class Magento\Cybersource\Gateway\Request\SilentOrder\TransactionDataBuilder using below steps

  etc/di.xml

<preference for="Magento\Cybersource\Gateway\Request\SilentOrder\TransactionDataBuilder" type="<vendor>\<module>\Gateway\Request\SilentOrder\TransactionDataBuilder" />

  vendor\module\Gateway\Request\SilentOrder\TransactionDataBuilder

<?php

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Vender\Module\Gateway\Request\SilentOrder;

use Magento\Framework\Math\Random;
use Magento\Payment\Gateway\Helper\SubjectReader;
use Magento\Payment\Model\InfoInterface;

/**
 * Class TransactionDataBuilder
 */
class TransactionDataBuilder extends \Magento\Cybersource\Gateway\Request\SilentOrder\TransactionDataBuilder {

    /**
     * Builds ENV request
     *
     * @param array $buildSubject
     * @return array
     * @throws \InvalidArgumentException
     */
    public function build(array $buildSubject) {
        $paymentDO = SubjectReader::readPayment($buildSubject);

        return [
            self::TRANSACTION_UUID => $this->random->getRandomString(
                    self::RANDOM_LENGTH,
                    Random::CHARS_DIGITS
            ),
            self::REFERENCE_NUMBER => $this->getReferenceNumber($paymentDO->getPayment()),
            self::TRANSACTION_TYPE => $this->transactionType,
            self::AMOUNT => sprintf('%.2F', SubjectReader::readAmount($buildSubject)),
            self::CURRENCY => $paymentDO->getOrder()->getCurrencyCode(),
            self::LOCALE => substr($this->localeResolver->getLocale(), 0, 2)
        ];
    }

    /**
     * Returns reference number
     *
     * @param InfoInterface $payment
     * @return string
     */
    private function getReferenceNumber(InfoInterface $payment) {
        return 123456789;
    }

}

But it's not working in my case, I also tried to add code in etc/frontend/di.xml but, still the same result. Can anyone help me out?

Thanks in Advance.


texts: cannot update shopping cart error: After add cutom comment bar in cart

texts: i am facing this issue. while update comment in cart page. and same is working on different source,pl help me to solve this issue. i have attached link which i have used for comment system in cart page for each product.


texts:
How can I customise the Total calculation so that it will calculate only the price of certain products with some specific attribute value?

I tried by re-creating Magento/Quote/Model/Quote/Address/Total/Subtotal.php and inserted my attribute value condition inside the collect method foreach.

foreach ($items as $item) {
        if($this->_product->load($item->getProductId())->getData('product_store_type') == 214)
        {
             ...
        }
       }

But not working !! Still it shows sum of all products price in total.

Any Suggestions or Opinions?

Brief Description about the Project Requirement:

I have two different domain stores. But they can share their cart details. So that I can add products from both the sites and checkout together. Now, First store uses redeem points instead of currencies and the second store uses USD.

I am using a store_type attribute value to change the Price format to "Points" in the frontend pages.

So In my checkout cart page order summary section, I need to show subtotal (USD) & subtotal (points) separately. No Grand total will be there. The same in the mini cart also.


texts: Magento 2 creditmemo items getting twice in $creditMemo->getAllItems();

texts: Magento credit memo items details getting twice.how to avoid this problem anyone help me


texts: Join Collection with other table to get title from another table

texts:
I have two table which are as below. I would like to match title based on first table and select title form another table for all the first table.

My code for get this resul is

$collection = Mage::getModel('specificationvalues/specificationvalues')->getCollection();
  $collection->getSelect()->join(array('ot' =>'specificationoptions'),"main_table.options = ot.specificationoptions_id",array('optiontitle' =>'ot.title'))

But it gives only 4 records

Table Structure.

    Main Table

specificationvalue

specificatinovalue_id   title       options
1                       value1        1
2                       value2        2
3                       value3        2
4                       value4        3
5                       value5        3
6                       value6        4
7                       value7        4
8                       value8        4
9                       value9        4
10                      value10       4

Join Table

specificatinooptions

specificationoptions_id   title
1           option1
2           option2
3           option3
4           option4

Result should be

specificatinovalue_id   title       optiontitle
1                       value1        option1
2                       value2        option2
3                       value3        option2
4                       value4        option3
5                       value5        option3
6                       value6        option4
7                       value7        option4
8                       value8        option4
9                       value9        option4
10                      value10       option4


texts: Magento 1 Sql query for product name, sku and quantity

texts: I am using Magento 1. I want to fetch product names, SKUs, and stock quantity with SQL queries. If anyone knows please let me know. Thanks in advance.


texts:
I want to override Magento Admin Menu but it does not seem to work.

This is my code:

app/code/local/Arabnewtech/Adminhtml/config.xml

    <?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Arabnewtech_Adminhtml>
            <version>0.1.0</version>
        </Arabnewtech_Adminhtml>
    </modules>

    <global>
        <blocks>
            <arabnewtech_adminhtml>
                <class>Arabnewtech_Adminhtml_Block</class>
            </arabnewtech_adminhtml>
            <adminhtml>
                <rewrite>
                    <page_menu>Arabnewtech_Adminhtml_Block_Page_Menu</page_menu>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

app/code/local/Arabnewtech/Adminhtml/Block/Page/Menu.php
and this is Menu.php

       class Arabnewtech_Adminhtml_Block_Page_Menu extends Mage_Adminhtml_Block_Page_Menu {
    public function foo() {
        return "
foo
";
    }

    public function getMenuLevel($menu, $level = 0) {
        $html = '
' . PHP_EOL;
        foreach ($menu as $item) {
            $html .= '
 '
                    . $this->escapeHtml($item['label']) . '' . PHP_EOL;

            if (!empty($item['children'])) {
                $html .= $this->getMenuLevel($item['children'], $level + 1);
            }
            $html .= '
' . PHP_EOL;
        }
        $html .= '
' . PHP_EOL;

        return $html;
    }

}


texts: Save is deprecated when try to create attributes set

texts:
I try to create programmatically some attributes set.
I find this code :
    $setup = $this->moduleDataSetup->getConnection();
    $setup->startSetup();
    $categorySetup = $this->categorySetupFactory->create(['setup' => $this->moduleDataSetup]);

    $attributeSet = $this->attributeSetFactory->create();
    $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
    $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);

    try {

        foreach ($attributeSetNameArray as $attributeSetName) {
            $data = [
                'attribute_set_name' => $attributeSetName,
                'entity_type_id' => $entityTypeId
            ];
            $attributeSet->setData($data);
            $attributeSet->validate();
            $attributeSet->save();
            $attributeSet->initFromSkeleton($attributeSetId);
            $attributeSet->save();
        }
    } catch (\Exception $exception) {
        throw new InputException(__($exception->getMessage()));
    }

    $setup->endSetup();

It's work perfectly, but my PhpStorm say that the Method "save" in

$attributeSet->save();
$attributeSet->initFromSkeleton($attributeSetId)->save();

is deprecated.
Do you know why is deprecated ? How can I fix this ?
Thank you


texts:
Im want to add error message in payment block when Cash on delivery payment method is not available

http://prntscr.com/iqh8sj

Can anyone help how can i do it in magento2


texts: Magento2 | Which procedure to upgrade to 2.2.6 in area development / GIT?

texts:
We have started development on a Magento CE 2.2.5 and installed theme
  / modules and custom module. We are working with local project/server
  versioned with GIT.

  The gitignore file specify to not look in vendor folder.

  I want to modify one time files on my local project then deploy
  changes thought a commit on the server and work for all developers. Is
  it possible ?

  If a download 2.2.6 source files from Magento website and override    file in the GIT project, it will override composer.json and
  composer.lock in which custom modules dependencies are specified.
  If I run magento command from my local side, I think all developers have to run command and GIT project should blow up with local files
  changes made by the upgrade.

  How could I process ?

  Should I merge composer.json and composer.lock with 2.2.6 composer
  files then commit override core files and run composer upgrade on
  server and local projects ?

Update 2018-10-15 :

After a long search, finally I gave up the main idea to only run cmd on my local side, commit and deploy without more actions from others :)
Find below the procedure I have followed :

Save composer.json and composer.lock files version 2.2.5
Modify gitignore file and exclude composer.json and composer.lock files
Update locally your version of Magento from 2.2.5 to 2.2.6 following the procedure described on the official Magento website : https://devdocs.magento.com/guides/v2.0/comp-mgr/cli/cli-upgrade.html
Git commit and push all changes in the Magento core files on the development server
Git pull on the server. Re add composer files previously saved (2.2.5).
Run Magento update procedure with composer. As the gitignore file specify to not look in vendor folder, there is no conflict.

After this, your local version and server version of Magento should be 2.2.6

Then for the team :

If there is an existing version, this is the same way as the local update (save composer files, pull git, re add composer files 2.2.5 and update to 2.2.6)
If this a new project, sync the project, add composer files already in 2.2.6 (copy from server) then install with composer install cmd.


texts:
When we click on "zip code" & enter "check" button,

Then we are displaying "Available with 14 sellers" , in front of that text, i want to display entered zip code : "110001".

I need :" Available with 14 sellers 110001 "

result.phtml

<?php echo "Available with 14 sellers";?>

<?php echo $this->htmlEscape($this->getFieldValue('postcode')) ?>

form.phtml

<?php if ($this->isFieldVisible('postcode')): ?>

<label for="search"<?php if ($this->isFieldRequired('postcode')):?> class="required" <?php endif;?>><?php if ($this->isFieldRequired('postcode')):?>*<?php endif;?><?php echo Mage::helper('webdevlopers_productpageshipping')->__('') ?>

<input placeholder="Enter your PIN Code" class="input-text <?php if ($this->isFieldRequired('postcode')):?>
required-entry<?php endif;?> validate-length maximum-length-6 minimum-length-6 validate-digits" type="text"
id="estimate_postcode" name="estimate[postcode]"
value="<?php echo $this->htmlEscape($this->getFieldValue('postcode')) ?>"
onkeydown="if (event.keyCode == 13) { return false;}" />

<?php endif; ?>

ex : please visit link1 & enter "110001" in textfield and click on "check" button.


texts: Wishlist controller is not extending to the new file

texts:
NOTE: This is Magento 1.4.  Because of the complex configuration of some of our products, I'm having to route the wishlist function addAction() over to the app/code/local section of Magento.  However, the reroute is not taking effect.  Here is what I have done:

created this folder/file:
app/code/local/Mycompany/Wishlist/etc/config.xml

inside I have this code:

<?xml version="1.0" ?>
<config>
    <modules>
        <Mycompany_Wishlist>
            <version>0.1.0</version>
        </Mycompany_Wishlist>
    </modules>
    <frontend>
        <routers>
            <wishlist>
                <args>
                    <modules>
                        <Mycompany_Wishlist>Mycompany_Wishlist</Mycompany_Wishlist>
                    </modules>
                </args>
            </wishlist>
        </routers>
    </frontend>
</config>

created this folder/file:
app/code/local/Mycompany/controllers/IndexController.php

with this code:

require_once 'Mage/Wishlist/controllers/IndexController.php';
class Mycompany_Wishlist_IndexController extends Mage_Wishlist_IndexController
{
    /**
     * Adding new item
     */
    public function addAction()
    {
        exit('hello world, I'm in the new file!');
        $session = Mage::getSingleton('customer/session');
        $wishlist = $this->_getWishlist();
        if (!$wishlist) {
            $this->_redirect('*/');
            return;
        }
        .. etc. ..

I HAVE CLEARED MY CACHE.  Why is the new file not being recognized?


texts: How to get Magento2 product with REST if sku has slash?

texts:
Does anyone have an idea about how to get a product with slash through the rest api ?

I have a product with sku 100/1.
The closest I have gotten is to call:

get /rest/V1/products/100%252f1

But it returns {"message":"Requested product doesn't exist"}

Any idea ?

/Thomas


texts: Add "Price from" to configurable products which contain different price simple products - Magento 2

texts: How to add a string like "Price from" next to configurable product prices on Category, Search and Product pages, but only if the configurable product has simple products with different prices in it?


texts: Modifying the dataLayer variables for e-commerce tracking with GTM

texts:
I'm using Google Tag Manager to track purchases on a Magento website. I've set up GTM through the Magento admin and every product related event is triggering fine (productDetails, addToCart, purchase etc...).

I'm however having an issue with the checkout process. The only product data included in the dataLayer is the product id, name, price and quantity. I would however like to have the category of the product be included as well, so that I can see directly in Analytics the products sold by category.

Is there a way to update the variables in the dataLayer for the checkout and purchase steps, and if so how? I've been scouring the web for hours but can't seem to find an answer...


texts: Magento 2 after upgrade from 2.2.4 to 2.3.4 category data not saving

texts:
After upgrade from Magento 2.2.4 to 2.3.4 the category data not saving. However the category saves correctly and shows the correct saved message. But data inside it not loading.

While troubleshooting I have found in table "catalog_category_entity" if I edit any category Id(entity_id), it shows default attribute_set_id = 0. But the default magento category attribute_set_id is 3(catalog_category).

So while saving category,In table "catalog_category_entity" the value changes for attribute_set_id=3 from zero for a category. And data not showing in admin.

If I revert and change back to attribute_set_id = 0, all category attributes data showing in admin.

Any idea about this type of issue post upgrade to 2.3.4 ?


texts:
I am trying to export products with dataflow -Profiles and want to export the field created_at which is in the table catalog_product_entity. The created_at drop down option from field mapping, In database: puts an empty value as the result. Even if there are values in the table.

Would be great if anyone could help me


texts: Magento 2 : after migration why m2_cl tables are blank?

texts:
I have upgraded M1 Database in Magento 2.3.3 .

Migration succesfull but m2_cli tables are blank in M1 database .

what is the reason for it ?

How we can do delta migration with m2_cli tables ?


texts:
I have tried but not working.

To increase session to time for Admin  :

  Stores -> Configuration -> Advanced -> Admin -> Security -> Admin
  Session Lifetime (it must be in seconds).

Uncheckd uses System value option and add your value in the textbox.

The Minimumm second is 60 and the Maximum is 31536000 (for one year).

Refer below screenshot for more details.
Can you please help how to increase session log out time.


texts: how can i update magento 2.2.5 to 2.4.0 without data loss and bug?

texts:
Currently my website running on Magento 2.2.5.
I want to upgrade it with current version 2.4.0.
Please anyone suggests me how can I update it without getting any
issues.
wihtout lossing customized option in my Magento 2.2.5


texts: Only one attribute choice being saved at a time

texts:
I am creating choices for an Attribute however when I add 3 colour choices see example below and save only one of the colour choices is saved. Is this a known bug as this seems to be happening quite a lot now. If a known bug can any one offer a solution where all choices are saved instead of one at a time. Magento 1.7.0.2 bTW

Additional Information (FOR EXAMPLE)
Catalog > Attributes > Manage Attributes
Create a Color Attribute
Add Option > Green
Add Option > Blue
Add Option > Red
Save
View Attribute
Only the first attribute created is added. ie (Green)

Nothing to do with product!!!
Repeat

Create a Color Attribute
Add Option > Blue
Add Option > Red
Save
View Attribute
Only the first attribute created is added. ie (Blue)


texts: Multistore with subfolders - Including language code before store group in URL

texts:
I have a client who needs to include a language code before the store group in the URL. For example, the current setup is:

example.com/store1
example.com/store2

There are two subfolders in the root of the site named store1 and store2. Is it possible to include a lang code (i.e. fr, de, en) before the /store1 section of the URL?

example.com/en/store1

I understand that it would be best to use store codes, but seeing as we have two store groups, both needing "en", it wouldn't be possible due to it needing to be unique.

Any help would be appreciated!


texts: How to get Exact products by query in Magento 2

texts:
When we search the products in search bar Magento 2 will search and display the Relevance products followed by http://domain.com/catalogsearch/result/?cat=&q=sample+product.

I can see the method where Magento 2 rendering these products.

Module_Search/Model/ResourceModel/Query/Collection.php

/**
     * Set search query text to filter
     *
     * @param string $query
     * @return $this
     */
    public function setQueryFilter($query)
    {
        $this->getSelect()->reset(
            \Magento\Framework\DB\Select::FROM
        )->distinct(
            true
        )->from(
            ['main_table' => $this->getTable('search_query')]
        )->where(
            'num_results > 0 AND display_in_terms = 1 AND query_text LIKE ?',
            $this->_resourceHelper->addLikeEscape($query, ['position' => 'start'])
        )->order(
            'popularity ' . \Magento\Framework\DB\Select::SQL_DESC
        );
        if ($this->getStoreId()) {
            $this->getSelect()->where('store_id = ?', (int)$this->getStoreId());
        }
        return $this;
    }

Now I want to change this query to exact product search like below Query.

SELECT * FROM products WHERE product_name LIKE "% Sample Product %";

How can I change Magento 2 setQueryFilter($query) Query condition?

Any help


texts:
I have a M2 install with data migrated over using the data migration tool. I have no extra modules or extensions enabled.

When I try to save a customer's data from the Admin, I simply get a blank screen, and this error in the PHP Log:

PHP Fatal error:  Class 'Magento\Framework\Data\Form\Filter\Datetime' not found in <magento-root>/vendor/magento/module-customer/Model/Metadata/Form/AbstractData.php on line 214

Is this a bug, or perhaps something wrong with installation?

Update

Based on suggestions below, I searched the entire Magento install (files and DB) for Filter\Datetime in the files, and \Datetime in the database, and that turned up nothing. That suggests to me that Magento is building a reference to Magento\Framework\Data\Form\Filter\Datetime dynamically, but I'm not sure how to track that down.

Update 2

I've managed to narrow it down to Magento trying to validate a field called "created_at" when saving a customer. I've confirmed that this field is getting assigned an input_filter of datetime, but I don't know where this gets set.


texts: Magento 2.3.0 does not change the language

texts:
I hope you can help me because no solution I find on the internet works.

Change the user's language to Spanish And in the local configuration also to Spanish.

Clean cache but I can not get it to be seen in the Spanish language.

I have tried some solutions (switch to developer mode), re-install the Spanish pack. But it does not work.


texts: Adding Product to category programmatically getting error in Magento 2.1

texts:
When I am adding the product to a category I am getting below error :

  "Category does not contain specified product"

The error comes from the below file :

  vendor/magento/module-catalog/Model/CategoryLinkRepository.php in deleteByIds()

My observer listen to catalog_product_save_after in order to add the product to sale category based on price:

$categoryIds = $_product->getCategoryIds();
array_push($categoryIds,$categoryidfromsettings);
$CategoryLinkRepository->assignProductToCategories($_product->getSku(), $categoryIds);


texts: How to undo bundling, merging, and minifying the JavaScript and CSS in Magento 2.1.x

texts:
I attempted to speed up my website by bundling, merging, and minifying the JavaScript and CSS through the Admin.

Stores> Settings> Configuration> Advanced> and then Developer, and changed the five options from "No" to "Yes".

Now, my website loads really fast, but some of the graphic elements like the shopping cart icon are just empty squares, and other elements are stretched and out of their places.  Also, I can't place anything in the cart.

The "Stores" tab no longer works in the Admin sidebar, so I can't get back in to reverse the changes.  Also, the graphic elements in the Admin sidebar are empty boxes also.

I have only been able to find a possible solution for Magento version 1.x, and I haven't found the database entries that were mentioned in my version, which is 2.1.8 CE.

I have backups of my entire website, including the database and the Magento installation.

I am database savy, so if anyone knows which database settings I need to change to set the options back to "No", and which bundled, merged, and minified JavaScript and CSS files (I assume they are in pub/static) I need to replace with the ones from my backups, or other solutions that work, please let me know.

If it is of any help, the store was installed through my cPanel using Softaculous, and there are no third-party extensions in use.

I have no intention of using bundling, merging, and minifying again.

Thank you very much for your help.

These are some of the things that I have tried:

Switching back and forward from developer mode to production mode;

Emptied some 'var' folders;

php bin/magento setup:upgrade;

php -f /home/eq/public_html/bin/magento indexer:reindex;

php bin/magento deploy:mode:set production -s;

php -f /home/eq/public_html/bin/magento setup:di:compile;

php bin\magento setup:static-content:deploy;

php -f /home/eq/public_html/bin/magento cache:flush;

php -f /home/eq/public_html/bin/magento cache:clean;

php bin\magento setup:static-content:deploy;


texts: How to add "Add to cart" button in Catalog search

texts:
In the catalog search, only name & price is showing up in the results, but I want to have the "add to cart" button also.

Is it possible and if yes then how to do it?


texts: Magento 2: Category Pages from Page 2 shows without products always

texts:
I'm trying to migrate a Magento 1.9.3.6 to Magento 2.3 and I found a strange problem. I've got some categories with thousands of products, I can see 64 products in my first page or 16, but if I go to page 2 http://v2.dendago.eus/moda?p=2 it says that there is no product. In any category happens the same. I've re-indexed and cleaned cache multiple times.

Any advice?


texts:
I had a store with category path turned on for product urls. After realising that, it creates duplicate content issues in SEO, I turned it off.
Since product urls (with category path) are already linked in Social Media and Email Campaigns, Google Analytics tracking is showing lots of such visited urls.

Now I am trying to redirect the product with category path to the one having product url key only.
For example:
http://mystore.com/category/sub-category/product.html --> http://mystore.com/product.html
http://mystore.com/category/product.html --> http://mystore.com/product.html

I tried to use the following script which implements the event controller_action_predispatch but it's not working as expected:

public function controllerActionPredispatch(Varien_Event_Observer $observer)
{
    $action         = $observer->getControllerAction();
    $request        = $action->getRequest();
    $requestUrl     = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $request->getRequestUri();
    $fullActionName = $action->getFullActionName();
    $storeId        = Mage::app()->getStore()->getId();

    if (in_array($fullActionName, array('catalog_product_view'))) {
        $product  = Mage::registry('current_product');
        $category = Mage::registry('current_category');
        if ($product && $product->getId() && $category && $category->getId()) {
            $categoryUrlKey = $this->getCategoryUrlKey($category->getId(), $storeId);
            if (empty($categoryUrlKey)) {
                $categoryUrlKey = $category->getUrlKey();
            }

            if (stripos($requestUrl, '/' . $categoryUrlKey . '/') !== false) {
                $urlKey = $this->getProductUrlKey($product->getId(), $storeId);
                if (empty($urlKey)) {
                    $urlKey = $product->getUrlKey();
                }
                $redirectUrl = Mage::getUrl() . trim($urlKey, '/') . '.html';
                $action->getResponse()->setRedirect($redirectUrl, 301);
                $action->getRequest()->setDispatched(true);
                return;
            }
        }
    }
}

public function getCategoryUrlKey($categoryId, $storeId = 0)
{
    $resource   = Mage::getSingleton('core/resource');
    $connection = $resource->getConnection('core_read');
    $sql        = "select value from catalog_category_entity_url_key where entity_id = ? and store_id = ? limit 1";
    $urlKey     = $connection->fetchOne($sql, array($categoryId, $storeId));
    return $urlKey;
}

public function getProductUrlKey($productId, $storeId = 0)
{
    $resource   = Mage::getSingleton('core/resource');
    $connection = $resource->getConnection('core_read');
    $sql        = "select value from catalog_product_entity_url_key where entity_id = ? and store_id = ? limit 1";
    $urlKey     = $connection->fetchOne($sql, array($productId, $storeId));
    return $urlKey;
}

Any idea for the perfect solution?
I am using #Magento #EE version 1.13.

[Edit]
One strange thing is

$action->getResponse()->setRedirect($redirectUrl, 301);
$action->getRequest()->setDispatched(true);

redirection doesn't work in live server but works in localhost.


texts: Magento 2: I have a problem with configuring gallery magnifier in product details page

texts:
I'm looking for an effect like the one this site or at least close to it:

https://fashionmix.bg/mazhki-cherni-visoki-ketsove-shagren-it251019-16

But when I configure magnifier in view.xml and set zoom mode to "Inside", there is a square that does not move smoothly.

Is there any chance of achieving what I want or I just should use external plugin for zoom.

P.S. Magento version is 2.3.2

Тhere is not much code to show it is standard Magento functionality, but still, here you are my configuration in etc/view.xml:

<var name="magnifier">
  <var name="fullscreenzoom">20</var>
  <var name="top"></var>
  <var name="left"></var>
  <var name="width"></var>
  <var name="height"></var>
  <var name="eventType">hover</var>
  <var name="enabled">true</var>
  <var name="mode">inside</var>
</var>

Thank you in advance for help!


texts: not able to redirect to cart page inside controller method

texts:
In one of my controller's method, I have:

$this->_redirect('checkout/cart', array("_forced_secure" => true));

Though, it doesn't work and redirects to 'checkout/account' instead. I've also tried:

$this->_redirectUrl( Mage::getUrl('checkout/cart') );

Am I missing something?


texts:
I can't find the option to enable this confiuguration on Magento 2:

  allow magento frontend to run in frame

on magento 1 was in system > configuration > admin > security

This old post shows how to do on magento 1: old post


texts: Allow HTML tags for Bank Transfer Payment Method Instructions

texts:
I want to add some instructions with HTML tags to style content for the instructions text.

When I'm adding tag in the textarea but it's displaying tags on the frontend not converting HTML tags to output.

  magento\vendor\magento\module-offline-payments\view\frontend\web\template\payment\banktransfer.html


texts: RequireJs on uncheck checkbox value is not unset

texts:
Using requireJs when Checkbox get unchecked, it is not deleting that value from element.value
function registerCategoryNews(grid, element, checked) {
            if (checked) {
                if (element) {
                    element.disabled = false;
                    if(typeof categoryNews === 'string'){
                        categoryNews = JSON.parse(categoryNews);
                    }
                    categoryNews[element.value] = "";
                    categoryNews = JSON.stringify(categoryNews);
                    console.log(categoryNews);
                }
            } else {
                if (element) {
                    element.disabled = false;
                }
                categoryNews.unset(element.value);

                console.log(categoryNews);
            }

            $('in_news_ids').value = categoryNews; // add your hidden field id
            //console.log(categoryNews);

            grid.reloadParams = {
                'selected_news[]': categoryNews.keys()
            };
        }


texts:
The search function does not work properly, for instance when I search for SKM 500-965 it does not show that product and shows other products but the product SKM 500-965 exists.

I have disabled search in attributes for all of them except the product name and manufacturer

Website link: http://aes-audio.com/index.php

Search term:SKM 500-965 or Sennheiser SKM 500-965

Please advise how can I make the search accurate for when user search for a product it shows that product only.

Thank you.


texts: How to use the required validation in customer add form for a custom filed?

texts:
I have created a custom field in customer add form. I want that filed as required field in the customer add form but not in customer edit form. Please suggest how can I implement this.

Thanks in advance.


texts:
I have a magento admin grid module and when I am inside the grid on the admin menu it shows me the header and the add item button but it throws this error

Fatal error: Call to undefined method NAMESPACE_Garantiaextendida_Model_Mysql4_Garantiaextendida_Collection::setPageSize() in G:\xampp\htdocs\webpage\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php on line 553

This is my mysql4 model collection

   <?php

class Felisiakluciano_Garantiaextendida_Model_Mysql4_Garantiaextendida_Collection extends  Mage_Core_Model_Mysql4_Collection_Abstract
{
    protected function _construct()
    {
        $this->_init('garantiaextendida/garantiaextendida');
    }
}

Can somebody help me? Please its more than urgent. Thanks and Good Bye.


texts: Magento 2 import product attribute type fixed product tax

texts:
How can i import a products with an attributes of type "Fixed Product Tax" ?

When i export a csv from the back office i don't have any attribute of type "Fixed Product Tax"


texts:
Anyone tried using Lesti_FPC with Magento 1.4?
Worked? Challanges?

On Gordon's website says:
Lesti_Fpc is compatible with Magento CE 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7, 1.8, 1.8.1, 1.9


texts: Using Widgets and the Base Design Package

texts:
When you're setting up a widget instance, Magento asks you to select a Design Package/Theme.  This includes the base/default package.

Why is this here?  Can is be used for anything?  My initial assumption would be this is here to add a widget to all themes — but that doesn't appear to work.  Am I incorrect in this and just doing something wrong?

My next assumption is the widget UI was designed to "display all themes", but didn't take into account the special behavior of the base design package.

Can this base/default entry be used for anything in a Widget Instance?  Or is it a vestigial feature, present only to confuse us?


texts:
i had done code to add image via webservice api , my code works fine , i just wan to set it as thubmbnail , default and base image how can i do it below is snippet of my code.

error "Image does not exist."

require_once '../app/Mage.php';
umask(0);
$app = Mage::app();
$session = Mage::getSingleton('customer/session', array('name'=>'frontend'));

//create a new product
try {

  $serverurl = 'http://******/apis/error2.png';
  $product = Mage::getModel('catalog/product');
  $stockData = $product->getStockData();
        $stockData['qty'] = 10;
        $stockData['is_in_stock'] = 1;
        $stockData['manage_stock'] = 1;
        $stockData['use_config_manage_stock'] = 0;

    $product->setStoreId('default')
    ->setTypeId('simple')
    ->setAttributeSetId(4)
    ->setName('4You banner5')
    ->setDescription("This widget will give you years of trouble-free widgeting.")
    ->setShortDescription("High-end widget.")
    ->setSku('4you5')
    ->setWeight(1.0)
    ->setStatus(1)
    ->setVisibility(4)
    ->setPrice(15.49)
    ->addImageToMediaGallery($serverurl,array('thumbnail','small_image','image'),true,false)
    ->setTaxClassId(0)
    ->setStockData($stockData)
    ->setCategoryIds('3')
    ->setHasOptions(1)
    ->setProductOptions(array($options))
    ->setCanSaveCustomOptions(true)
    ->save();

  echo 'OK Product ID: '.$product->getId();

      $cache = Mage::getSingleton('core/cache');
      $cache->flush();
}
catch (Mage_Core_Exception $e) {
  echo $e->getMessage();
}
catch (Exception $e) {
  echo $e;
}


texts: After deleting quote on login, incorrect "My Cart" value until you actually view the cart

texts:
I am trying to ensure that customers carts are not saved upon logout.

I have the following Observer method that fires on load_customer_quote_before:

public function deleteQuote(Varien_Event_Observer $observer) {
    $customerQuote = Mage::getModel('sales/quote')
        ->setStoreId(Mage::app()->getStore()->getId())
        ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomerId());
    $customerQuote->removeAllItems();
    $customerQuote->save();
}

This is resulting in some bizarre behavior, however.  If the customer had items in their cart in last logout, and I do a customer login with items in the cart, things work fine.

However, if the customer had items in their cart and I do a customer login with NO items in the cart, I see at the links at the top of the page "My Cart (X items)" where X is equal to the number of items that were in the customer's cart.  This link (which I've cropped from a publicly available site):

This isn't just a passing thing, this incorrect number remains no matter where else I go on the site...

...until I actually click on the "My Cart" or "Checkout" link.  Then, reality catches up it and it realized that I killed the old quote and displays the correct number of items with either no items or a couple of them depending on if I had added any items to the cart after logging in.  It's almost as if there is a count somewhere that doesn't update unless it has to.

This is really bizarre.  How can I fix this number?


texts:
I just did a fresh installation of Magento 1.9.0.1 and I am seeing some very odd behavior with the customer login form.

In Chrome (version 36) the login form does not work. I am just redirected to the login page. There is no error message. However, when I open a new Incognito Window, I am able to login just fine. Thinking this was a cookie problem, I cleared out all my cookies from the browser and tried again and I got the same results. In both cases, I am able to login to the admin panel without any issues.

I have also tried this in Firefox . On Firefox its work properly ..
thank you


texts: Direct INSERT sql query not working in observer of Magento?

texts:
I am using Event catalog_category_save_after. In observer fetch query is working fine but insert and delete query is not working.

Below is my code :

  $resource = Mage::getSingleton('core/resource');
  $readConnection = $resource->getConnection('core_read');
  $writeConnection = $resource->getConnection('core_write');
  $tableName = $resource->getTableName('catalog_category_product');

  $query = 'INSERT INTO ' . $tableName .' (`category_id`,`product_id`,`position`)VALUES("215","33702","5");';
  $test1 = $writeConnection->query($query);

Below querey is generating:

INSERT INTO catalog_category_product (`category_id`,`product_id`,`position`)VALUES("215","33702","5");

Can anyone help me in this?


texts:
I put my magento site on maiatenance mode whislt I did a back up.

after the back i deleted all the file in the server because i wanted to start afresh because of a database issue.

but to my surprise I am getting an error when i visit the domain even when there are no files on the server.

what could be the problem?

I even deleted the cpanel account from WHM and created from the scratch but anytime i visit the domain, I get that error.

Very strange!!

please see attached.


texts: How to get a document containing order details

texts:
How do I get a document for a specific order in Magento (1.x) and (2.x) if possible please.

{
    "id": 100,
    "customer_id": 10,
    "date_created": "Wed, 14 Nov 2012 19:26:23 +0000",
    "date_modified": "Wed, 14 Nov 2012 19:26:23 +0000",
    "date_shipped": "",
    "status": "New",
    "subtotal_ex_tax": "99.0000",
    "subtotal_inc_tax": "99.0000",
    "subtotal_tax": "0.0000",
    "base_shipping_cost": "0.0000",
    "shipping_cost_ex_tax": "0.0000",
    "shipping_cost_inc_tax": "0.0000",
    "shipping_cost_tax": "0.0000",
    "shipping_cost_tax_class_id": 2,
    "base_handling_cost": "0.0000",
    "handling_cost_ex_tax": "0.0000",
    "handling_cost_inc_tax": "0.0000",
    "handling_cost_tax": "0.0000",
    "handling_cost_tax_class_id": 2,
    "base_wrapping_cost": "0.0000",
    "wrapping_cost_ex_tax": "0.0000",
    "wrapping_cost_inc_tax": "0.0000",
    "wrapping_cost_tax": "0.0000",
    "wrapping_cost_tax_class_id": 3,
    "total_ex_tax": "99.0000",
    "total_inc_tax": "99.0000",
    "total_tax": "0.0000",
    "items_total": 1,
    "items_shipped": 0,
    "payment_method": "cash",
    "payment_provider_id": null,
    "payment_status": "",
    "refunded_amount": "0.0000",
    "order_is_digital": false,
    "store_credit_amount": "0.0000",
    "gift_certificate_amount": "0.0000",
    "ip_address": "50.58.18.2",
    "geoip_country": "",
    "geoip_country_iso2": "",
    "currency_id": 1,
    "currency_code": "USD",
    "currency_exchange_rate": "1.0000000000",
    "default_currency_id": 1,
    "default_currency_code": "USD",
    "staff_notes": "",
    "customer_message": "",
    "discount_amount": "0.0000",
    "coupon_discount": "0.0000",
    "shipping_address_count": 1,
    "is_deleted": false,
    "billing_address": {
      "first_name": "Martin",
      "last_name": "Sheen",
      "company": "",
      "street_1": "12345 Fake Street",
      "street_2": "",
      "city": "Austin",
      "state": "Texas",
      "zip": "12345",
      "country": "United States",
      "country_iso2": "US",
      "phone": "",
      "email": "elsie@example.com"
    },
    "products": [
        {
            "id": 16,
            "order_id": 115,
            "product_id": 111,
            "order_address_id": 16,
            "name": "Some Product",
            "sku": "",
            "price": "33.0000",
            "qty": 3,
        }
    ],
    "shipping_addresses": [
        {
          "first_name": "Martin",
          "last_name": "Sheen",
          "company": "",
          "street_1": "12345 Fake Street",
          "street_2": "",
          "city": "Austin",
          "state": "Texas",
          "zip": "12345",
          "country": "United States",
          "country_iso2": "US",
          "phone": "",
          "email": "elsie@example.com"
        }
    ],
    "coupons": [
        {
          "id": 1,
          "coupon_id": 1,
          "order_id": 115,
          "code": "557D2DEA0CCAFA1",
          "amount": "5.0000",
          "type": 1,
          "discount": "4.6600"
        }
    ]
  }

I accept Magento probably doesn't spit documents like this out by default, and that some work will be needed to create such a structure, but I have no idea what the field names are or would be (not all fields essential, just shipping & billing address, customer details, status, totals and sub-totals, items, discounts & coupons).

If anything is not available from the above-abbreviated list, please let me know. Also how to say an order is shipping in Magento, and where to add tracking numbers?

Thanks in advance.


texts:
I load the following code:

<?php if (isset($item['delivery_eta'])): ?>
<?php $date = DateTime::createFromFormat('m-d-Y', $item['delivery_eta']);
if (!$date) { $date = DateTime::createFromFormat('Y-m-d', $item['delivery_eta']); }
?>
<?php foreach ($this->getOutOfStockItems()->getData() as $item): ?>
    <?php echo $this->getFormatedDate($date->format('Y-m-d'), 'full') ?>
<?php endforeach ?>

This is displaying the date into the following output: Friday 15 December 2017

But now I need to get the php line, that only displays Friday.

How can I achieve that?

I also need the php line for only the day, in this example 15.
And also only the month, in this example December.

How can I get these values?


texts:
I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config.

var config = {
    map: {
        '*': {
            'Magento_Customer/js/model/authentication-popup': 'Vendor_CustomPopup/js/model/authentication-popup-download'
        }
    }
};

and my modified JS looks like this:

define(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function ($, modal) {
        'use strict';

        return {
            modalWindow: null,

            // Create popUp window for provided element
            createPopUp: function (element) {
                this.modalWindow = element;
                var options = {
                    'type': 'popup',
                    'modalClass': 'popup-authentication',
                    'responsive': true,
                    'innerScroll': true,
                    'trigger': '.download-purchase', // only change needed
                    'buttons': []
                };
                //console.log(options);
                modal(options, $(this.modalWindow));
            },

            // Show login popup window
            showModal: function () {
                $(this.modalWindow).modal('openModal');
            }
        }
    }
);

The only change I need to apply is the trigger in the options, this works, but is there a better way of modifying this without overriding the whole function?


texts: Report to tell how long it took from order to shipping

texts:
I am trying to find out if there is a report to show how long (how many days) it took for orders to be shipped.

For instance, for July the average lapse from order to shipping was 2 days etc.


texts: Magento2 Products on Category after deployment

texts:
I recently did a release on my magento2 instance on production. Everything looked good for a day, then enabled some configuration and styling went away from all product pages. So I reverted that and rebuilt (di, static files, setup:upgrade, etc). Now all our category pages have no products and seeing an error like the following:

Uncaught exception 'TypeError' with message 'Argument 8 passed to Magento\Catalog\Model\ProductRenderList::__construct() must be of the type array, null given, called in /var/www/vhosts/xyzcorp.com/releases/20190718151507/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111' in /var/www/vhosts/xyzcorp.com/releases/20190718151507/vendor/magento/module-catalog/Model/ProductRenderList.php:71

I follow the entire stack trace and it is all core magento files. Any ideas on this?


texts:
I am using magento1.7.0.2 , want to perform some operation while user submit request for forgot password from frontend using event observer.

i tried customer_save_after is a event for adminhtml not for frontend.

any help would be appreciate!


texts: Configurate taxes for payment types in Magento2

texts:
I would like to include a tax of 1€ when customer selects "Cash on Delivery" payment method and
2% when selects  "Paypal".

Is there a way to implement this?

Thank you


texts: How can i change so that my site only show price with tax

texts: Help, i am trying to get my T-shirt shop http://tex-tryk.dk/ to show frontend price with tax as the is now low in Denmark ?


texts: Magento2.3.5: How to override \Magento\Checkout\Controller\Cart\Index Controller?

texts:
I was trying to override \Magento\Checkout\Controller\Cart\Index controller.
I created a di.xml file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Controller\Cart\Index" type="Test\Checkout\Controller\Rewrite\Checkout\Cart\Index" />
</config>

and created controller Test\Checkout\Controller\Rewrite\Checkout\Cart\Index.php
 <?php

namespace Test\Checkout\Controller\Rewrite\Checkout\Cart;

use Magento\Framework\Data\Form\FormKey;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\Product;

class Index extends \Magento\Checkout\Controller\Cart\Index
{
    protected $scopeConfig;
    protected $formKey;
    protected $cart;
    protected $product;

    const FREE_INCLUSIONS = 'additionalServices/general/free_inclusions';

    public function __construct(
        FormKey $formKey,
        Product $product,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        parent::__construct(
            $context,
            $scopeConfig,
            $checkoutSession,
            $storeManager,
            $formKeyValidator,
            $cart
        );
        $this->scopeConfig = $scopeConfig;
        $this->formKey = $formKey;
        $this->cart = $cart;
        $this->product = $product;
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {
        $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
        $free_inclusions =  array_filter(explode(',', $this->scopeConfig->getValue(self::FREE_INCLUSIONS, $storeScope)));

        return parent::execute();
    }
}

but I'm still getting an error like Type Error occurred when creating object.
Can anyone help me out to override
Thanks in advance.


texts:
I want to get product details from url key.

Is there a way to get product details from url_key, I am new to Magento and could not find any such way, please help I tried below code but it is not working properly.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->create('\Magento\Store\Model\StoreManagerInterface');
$storeIds = array_keys($storeManager->getStores());
$action = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\Action');

while($row = mysqli_fetch_assoc($result)) {
    $updateAttributes = array();

    echo $row["slug"];
    echo "--->";
    $productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
    $collection = $productCollectionFactory->create();
    $collection->addAttributeToFilter('url_key',"URL_KEY_HERE");
    $collection->addAttributeToSelect('*');
    foreach ($collection as $product)
    {
        echo "id is ->".$product->getId();
        echo "<br>";
    }
}


texts: Magento 2 : How to get category data by category id?

texts:
I have product object & i get category ids using
$category_id = $product->getCategoryIds();

I need the collection for the category ids which i get in $category_id
What will be the best & optimized way to get it in (block or helper  or model) ?
Thanks


texts: How to disable/remove salable quantity in Magento 2

texts:
Please disable this module in app/etc/config.php file.

'Magento_Inventory' => 0
'Magento_InventoryAdminUi' => 0
'Magento_InventoryApi' => 0,
'Magento_InventoryBundleProduct' => 0,
'Magento_InventoryBundleProductAdminUi' => 0,
'Magento_InventoryCatalog' => 0,
'Magento_InventorySales' => 0,
'Magento_InventoryCatalogAdminUi' => 0,
'Magento_InventoryCatalogApi' => 0,
'Magento_InventoryCatalogSearch' => 0,
'Magento_InventoryConfigurableProduct' => 0,
'Magento_InventoryConfigurableProductAdminUi' => 0,
'Magento_InventoryConfigurableProductIndexer' => 0,
'Magento_InventoryConfiguration' => 0,
'Magento_InventoryConfigurationApi' => 0,
'Magento_InventoryDistanceBasedSourceSelection' => 0,
'Magento_InventoryDistanceBasedSourceSelectionAdminUi' => 0,
'Magento_InventoryDistanceBasedSourceSelectionApi' => 0,
'Magento_InventoryElasticsearch' => 0,
'Magento_InventoryGroupedProduct' => 0,
'Magento_InventoryGroupedProductAdminUi' => 0,
'Magento_InventoryGroupedProductIndexer' => 0,
'Magento_InventoryImportExport' => 0,
'Magento_InventoryIndexer' => 0,
'Magento_InventoryLowQuantityNotification' => 0,
'Magento_InventoryLowQuantityNotificationAdminUi' => 0,
'Magento_InventoryLowQuantityNotificationApi' => 0,
'Magento_InventoryMultiDimensionalIndexerApi' => 0,
'Magento_InventoryProductAlert' => 0,
'Magento_InventoryReservations' => 0,
'Magento_InventoryReservationsApi' => 0,
'Magento_InventoryCache' => 0,
'Magento_InventorySalesAdminUi' => 0,
'Magento_InventorySalesApi' => 0,
'Magento_InventorySalesFrontendUi' => 0,
'Magento_InventorySetupFixtureGenerator' => 0,
'Magento_InventoryShipping' => 0,
'Magento_InventorySourceDeductionApi' => 0,
'Magento_InventorySourceSelection' => 0,
'Magento_InventorySourceSelectionApi' => 0,
'Magento_InventoryShippingAdminUi' => 0


texts: Howto Include Extension Template in Customer Account

texts:
We are trying to integrate the output of an extension into a customized phtml template:

The extension is called Magetrend Newsletter Popup Pro which normally creates a pop that is being triggered by js. It offers the opportunity to add custom fields for special target groups. We are using this feature aswell as the pop-up feature.

We would like to integrate the same output as in the above mentioned pop-up into the customer account to facilitate customers to change their settings.

The template to be used for this would be

./vendor/magento/module-customer/view/frontend/templates/form/newsletter.phtml

which we already placed in

./app/design/frontend/Vendor/theme/Magento_Customer/templates/form/newsletter.phtml

How would we be able to integrate the following template there:

./app/design/frontend/Vendor/theme/Magetrend_NewsletterPopup/templates/newsletterpopup/popup.phtml

We don't find anything on this in the web.


texts: proceed to checkout button is only show for login users

texts: I want to make a function in which only login user can see the proceed to checkout button at checkout page if non registered user will come at checkout page then they will see checkout button disabled


texts: Install Patch Using custom Module Composer In Magento 2

texts:
Is it possible install patches using my custom module 'composer.json'?
Actually my root 'composer.json' is in docker container, I don't have the access of that file.Now I want run one patch.
Thank you


texts:
I added multiple products in the cart using this below script.

<script>
    require(['jquery'], function (jquery) {
        document.getElementById("add").addEventListener("click", function () {

            //JipeJryj6w9kBpBD13fTZWz7qm0vinmg
            if (localStorage.getItem('gT') !== null) {
                guestToken = localStorage.getItem('gT');
            }
            console.log(guestToken);
            var qty = document.getElementById('<?php echo "qty".(string)$count; ?>').value;
            if (qty == 0) {
                qty = NULL;
            }

            var settings = {
                "async": true,
                "crossDomain": true,
                "url": "<?php echo $baseUrl ?>rest/V1/carts/mine/items",
                "method": "POST",
                "headers": {
                    "content-type": "application/json",
                    "authorization": "Bearer <?php echo $block->getToken() ?>",
                    "cache-control": "no-cache",
                    "postman-token": "fdf04024-bb48-15e6-77c1-22a9ba841f4d"
                },
                "processData": false,
                "data": JSON.stringify({

                    "cartItem": {
                        "sku": <?php echo $stringSku ?>,
                        "qty": qty,
                        "quote_id": guestToken
                    }

                }),

            }

            jquery.ajax(settings).done(function (response) {
                console.log(response);
            });

        })
    });

This function works fine. But my minicart looks likes this below screenshot.

But when I add products using default method the cart looks fine.


texts: Running php bin/magento commands returns nothing on 2.2.7 CLI php 7.0.22

texts:
I'm having some problems running the php bin/magento commands using PHP 7.0.22 on MAMP Pro, Mac, Magento 2.2.7

The commands was working about 2 hours ago when all of a sudden stopped working whereby my terminal would just seem to return nothing after running the command.

I have tried switching PHP versions to 7.1.12 however this isn't going to cause the problem, if anything I have better luck their but get an error relating to Encrypter.

I get the following errors when trying to run the Magento commands in my terminal and I'm not sure why:

[13-Feb-2019 16:38:19 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.0.22/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/MAMP/bin/php/php7.0.22/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): image not found in Unknown on line 0
[13-Feb-2019 16:38:25 UTC] PHP Fatal error:  Cannot declare class Zend_Mail_Message, because the name is already in use in /Applications/MAMP/htdocs/MYSITE/vendor/magento/zendframework1/library/Zend/Mail/Message.php on line 39

UPDATE

Changing to PHP 7.1 fixes the intl error, but I then get: Notice: Undefined variable: cipher in /Applications/MAMP/htdocs/MYSITE/vendor/magento/framework/Encryption/Encryptor.php on line 397 - I have the mcrypt.so module installed and active


texts: Magento2.4.0 - How to install latest version of Elasticsearch on hosting server

texts:
I have started a website build in Magento2.4.
How to check that Elasticsearch is installed Magento2.4 packages I have installed on my hosting server.
Please share command that I can run with ssh.
If it is not installed please share how do I install.
I have checked my admin panel setting & Elasticsearch connection is always getting failed with no alive nodes found in your cluster error.
Please fix this issue.
Please share details that relates to windows machine because I am running my magento site on windows machine.
I have to run my website soon.


texts: Magento 2 - Filter in custom grid displayed in customer view admin tab

texts:
I have created a custom tab in customer view and loaded grid inside the admin using below link successfully with filter tabs in the grid.

http://www.ibnab.com/en/blog/magento-2/magento-2-backend-create-custom-tab-in-customer-view-and-load-grid-inside-admin

But I find an error while filtering on custom data table as I used join query in the collection. Does anyone know how to make filter working for the custom table?


texts: How to Install extensions into Magento version 2.1.7 from Magento Connect?

texts:
I am using Magento 2.1.7. I am trying to install some extension from Magento Connect. But i am not able to do it.
Can anyone tell me the correct way to install an extension into my Magento version 2.1.7 from Magento Connect ?


texts:
I have a number of redundant Tax rates (539 when I only need 269) in Magento 2.2.7 and I'd like to remove them.

Is there a way to do this that doesn't involve going into each one and clicking the "Delete Rate"?


texts: Magento 2.3.5 Address Verification Suddenly Fails

texts:
For about month, my store has been making and completing sales. Now, suddenly it fails on address verification.
Vertex is not being used and it clears if we choose Shipping Option 2 (Overnight shipping at $34.95)
If a person chooses standard shipping, it fails Option 1 (Mageplaza Shipping methods module).
We even switched their amounts and it seems to fail only if 8.95 shipping is used not matter if it is option 1 or 2.  Seems odd to be tied to amount.


texts: Show a field for filter in grid.php from other custom table in magento 1.9.2.4?

texts:
I need to show a column in grid.php file of my module, and that field having data from custom table that is created separately but that table also contain the entity id of the module so they are related.

I also want to provide the filter functionality for this field so if user type anything in that field the custom table search the entity id of the module's row and return the result accordingly.


texts: Altering the anchor text of main navigation links

texts:
I'm looking for a way to edit the anchor text used for the links in my store's main navigation menu.

The reason for this is I'm looking to rename some categories to be more SEO-friendly, but this makes them quite long and meandering. For example, I want my "Women's" category to now be called "Women's fashion, clothes and shoes" but would like the link in the main navigation to remain "women's".

Is there a way of doing this?


texts: Magento 2 move header.links without mobile menu

texts:
I'm trying to move the header.links from header.panel to header-wrapper without removing the header.links from the mobile menu (store.links).

I tried it with a referenceContainer and the move command in theme/Magento_Customer/layout/default.xml

<referenceContainer name="header-wrapper">
    <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" before="-"/>
</referenceContainer>

OR

<move element="header.links" destination="header-wrapper"/>

Can someone tell me how to do it right?


texts:
I have some images on a homepage and everytime I add in a link it does not seem to be working, chances are im typing it wrong or missing something but if you can let me know how to add a link to the image in this code, that would be a great help.

thanks,

                        UP TO

50%

OFF


texts: Hi I have a question is it possible to make a one static block to get different content for every customer that is logged in. And with this to get different home page for the customers.


texts: Magento : Catalog Price Rules "Apply Rules" Programmatically

texts:
i'm create Catalog Price Rules Programmatically it's work fine.

The issue is, I need to login with admin and click button "Apply Rules" other wise discount is not apply in magento store. So I need "Apply Rules" programmatically and I try bellow code but its not work.

try{
  $catalogPriceRule = Mage::getModel('catalogrule/rule');
  $catalogPriceRule->applyAll();
} catch (Exception $e) {
  echo $e;
}

Any help or suggestion will be appreciated.