texts:
I was wondering whether the following can be achieved with magento:

A client submits an order for a product and selects a specific physical store location to pickup his product. That order is  then sent to that store. The seller at that store has restricted access to the admin panel where he can only manage orders relating to his store only. There are several stores and all have similar functionality. In a way a physical store has an own profile on the online store. There is also a super admin that controls everything. So instead of having 5 different online stores for each store, each store will just have individual access to the online store and manage the orders relating to their stores.

Please note that this is not "multi-vendor" as products across all stores are the same. In other words it is just one online store with multiple outlets.


texts: Is magento a right platform for my requirement?

texts:
I am having difficulty to decide if Magento CE(either 1.9.x, or 2.x) is capable of satisfying below scenario:

It is travel agency website, where customer can choose their tour package for different destination and do a checkout.

I believe Magento can handle above scenario like a charm. However, The agency requires another portal for their agent partners where they can sign up as an Agent and the admin approves their registration.

The agent will view the packages at the different pricing and can order and checkout.

They can also view their previous bookings or download the invoices for it. The invoice will have the Agent company logo (which they provided during their registration) and not the store logo.

I believe this is not possible using Magento out of the box, are there any extension available to help me to do what I want? Or I try considering a solution different than Magento?


texts: How can i add custom blocks in custom theme in magento 2.2.3?

texts: i have created custom theme in magento 2.2.3 and i want to add some custom block to home page.Please help me how i can add or write code for that.


texts: In Magento 2 how can I return a collection without the top 10% and bottom 10%?

texts:
I am looking to return a subset of reviews for example but discard the top x% and bottom x%

I could do it with an SQL query such as

SELECT * FROM
(
  SELECT review_date, review_score,  @r:= @r + 1 AS rownum
  FROM review_detail, (SELECT @r:=0) x
  ORDER BY review_score
) x
WHERE rownum > @r * .1
  AND rownum <= @r * .9
;

However I'm struggling to understand how I can order the collection and add a new field for the row number and then be able to order and sort it using the syntax within magento

when you get a collection is the row number updated so that if I sort by rating I can then address the row number?

I'm guessing I'd have to use Zend_Db_Expr to create the new field for row number sorted by review score then use array("from" => $fromValue, "to" => $toValue) in an addFilterToField Statement to return the collection

Any help would be greatly appreciated

EDIT : I've tried doing it by using limit and offset but this destroys the pagination on the screen but returns the correct data

 } elseif ($condition == Filter::EXCLUDE) {
            if ($value !== 'None') {
                $percentage = (float)$value;
                $current_size = $reviewCollection->getSize();
                $start_pos = round($current_size * ($percentage/100));
                $offset = $current_size - (2*$start_pos);
                $reviewCollection->getSelect()->limit($offset,$start_pos);
                $reviewCollection->getItems();


texts: How to transform a quote into an order from CALLBACK HOOKS, MAGENTO 2.3

texts:
I'm trying to integrate a payment gateway. And they provide a callback hooks i've set for them to return me the CartID (Quote's entity_id).

But from here on, it feels like it isnt right for me to call guest API, as the cart belongs to an actual customer's cart. Neither do i have the access tokens when the callback hook is being sent to the API i've created.

How can i create the order (sales_order table & sales_order_grid) based on the quote i could receive ?

Please advise what should i do as im stuck on this for 3 days.


texts: First line of the address is not displayed in sales order?

texts:
I can not get the first line of the address in receiver and sender address in sales -> order.

But when I click edit, it displays all the address line which I have given

Now I want to display the first line address in street address field in 1st line in the first image I have uploaded in back-end(admin). Kindly help me!! Spending more than 3 days:(


texts:
I'm trying to write a cron. I'm using magento 1.9.

This is my config.xml file:

<config>
<modules>
    <Kode_Testmodule>
        <version>0.1.0</version>
    </Kode_Testmodule>
</modules>
<frontend>
    <routers>
        <Kode_Testmodule_SomeFreeRouterName1>
            <use>standard</use>
            <args>
                <module>Kode_Testmodule</module>
                <frontName>test-module</frontName>
            </args>
        </Kode_Testmodule_SomeFreeRouterName1>
    </routers>
</frontend>

<global>
    <models>
        <kodetestmodule>
            <class>Kode_Testmodule_Model</class>
        </kodetestmodule>
    </models>
</global>
<crontab>
    <jobs>
        <kode_testmodule>
            <schedule>
                <cron_expr>*/2 * * * *</cron_expr>
            </schedule>
            <run><model>testmodule/cronmodule::orderstoday</model></run>
        </kode_testmodule>
    </jobs>
</crontab>

This is my Cronmodule.php:

<?php
class Kode_Testmodule_Model_Cronmodule{
public function orderstoday() {
    die("hello out");
}
}

?>

This is the error i'm getting:

exception 'Mage_Core_Exception' with message 'Invalid callback: testmodule/cronmodule::orderstoday does not exist' in C:\xampp\htdocs\magento\app\Mage.php:595
Stack trace:
#0 C:\xampp\htdocs\magento\app\code\core\Mage\Cron\Model\Observer.php(301): Mage::throwException('Invalid callbac...')
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Cron\Model\Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#4 C:\xampp\htdocs\magento\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#5 C:\xampp\htdocs\magento\cron.php(74): Mage::dispatchEvent('default')
#6 {main}

Any help whatsoever will be appreciated. Thanks in advance


texts: Magento 2: An error occurred on the server. Please try to place the order again

texts:
When user want to checkout sometimes i got below message.

After correction of Billing & Shipping Address Sometimes user able to place order some times not.

Due to this customer not able to order.

What will be the perfect solution for this?


texts: How can i change file and folder permission in one go in godaddy hosting?

texts:
I am facing a lot of issues due to file and folder permission in magento 1.9.2.1
What should be the file and folder permission codes.I am using 755for most.
Is there any way of changing the file and folder permission of all the files in one go ?


texts: Why all the products are not displayed on the category?

texts:
I came across a weird issue. There are around 400 products assigned to a category but it is only displaying around 150 products.

I verified the products enabled and all, actually those products show up on a search or another category.

So, in short, the product is assigned to multiple categories. It is displayed in a few categories but not one.

I tried reindexing but no luck.

The weirdest thing here is when I open the product on the admin panel and resave the product, I can see the product on the frontend. The problem is I can't open every product and save it again. Also after I tried that with few undisplayed products, I reindexed again and the products that appeared after saving individually disappeared again.

Can anyone passed through such a weird situation.

I'm stalled on what to do next to fix this. Can anyone help me with this? Any help would be appreciated. By the way, my Magento version is 2.1.3


texts: Magento 1.9: export a list of orders with specific data

texts:
I need to create report or export orders list as csv file, on a specified date range, where each of them have these data:

order id
date
import
products quantity
payment method

I am tried to Reports>Sales section in the backoffice but I never can get all the above dates.

I'm using Magento ver. 1.9.3.3


texts: How to get product Review/Ratings notification via email in Magento2

texts: In Magento2, Whenever a new product review posted in my store, I couldn’t get any notification. I’m always navigating to the review section to check and moderate the reviews/ratings. Is there any admin configuration available to get the product reviews/ratings notification via email?


texts: How to get the unique values from magento custom table?

texts:
$collection = Mage::getModel('saplocation/saplocation')->getCollection()
                    ->addFieldToFilter('location', array('like' => '%'.$location.'%'));

foreach ($collection as $values) {
    array_push($returnjson, $values['pincode']);
}
echo json_encode($returnjson);

How to get the unique values from magento table, i have tried distinct but it is not working. please help


texts: Product Catalog not updating but Search catalog is

texts:
Magento Version: 2.1.7 EE
Theme: Ultimo Theme - Infortis.

I'm using the theme config settings to update the Catalog view page but no matter what i do it doesn't even seem to update the view, even after clearing cache/indexing etc.

However i have noticed it does update the catalog search view, so the settings are working it's just not taking effect on the catalog page.

The theme support don't seem to have any idea why it's not working as it should, has anyone got any ideas what i can do/check?


texts: How to add a simple Boolean Flag value to each order item

texts:
I am looking for the simplest way to add a simple Boolean value to an order to indicate if the order was broken within the shipping process.  We mail a physical product out that sometimes get's damaged and need a simple way to mark an order as damaged or not.

I then have a separate system outside of Magento where I pull and build reports, so really I just need a way inside of Magento to add this value and ensure it is saved to the database for each order.

Could a Magento expert point me in the right direction, I am very new to Magento and it's a bit of a nightmare sometimes.

Actually after a though, I think it will need to be on each order item and not just the order, as some orders might have items that are not broke but other items that do break


texts: How to change products sort order in magento 2?

texts:
In product list page I need to change the sorting order. I have a current order like:

Description A-Z
Price High To Low
Price Low  to High
Description Z-A

I need to change it to.

Description A-Z
Description Z-A
Price High To Low
Price Low  to High

I tried using this JS.

window.onload = () => {
        const fontMenu = document.querySelector("#sorter");
        const options = Array.from(fontMenu.querySelectorAll("option"));
        // options.reverse();
             options.forEach((item,o) => {
                 options.splice(0,3);
                console.log(options,'op')
                options.unshift(item);
                fontMenu.appendChild(item);

             });
        }


texts: Configurable product error: Call to a member function count() on array

texts:
I have an error that occurs in production only. And even then it is about 3/10 times that it occurs. Refresh, seems alright, refresh again, seems broken etc. On the staging site + my docker box it seems to work fine.
So the problem:
The configurable product page is not being build 3 out of 10 times. Only a part of the following theme template is visible: Magento_ConfigurableProduct/templates/product/view/type/options/configurable.phtml .
The error starts from the $block->getJsonConfig() function in the template. It eventually calls on the function:
$this->getData('media_gallery_images')->count(). This resides in:
vendor/magento/module-catalog/Model/Product.php
This results in the error: Call to a member function count() on array.
The function: $this->getData('media_gallery_images') should always return an object as far as I know. So when it is an array it seem logical that it errors. I just cant figure out why it returns an array. Before that piece of code it also does the hasData check (with the setData) if it the check is false.
If you have an idea of the source of this problem, please post. I will investigate it then because I am at a loss at the moment.
Data:
Magento 2.3.5
PHP 7.1.33


texts:
I exported a live database from a magento installation with 2 websites and 3 different stores and imported it on another magento installation.

I already changed the base_url of the main store, but how can I change the base_url of the other stores as well? They are still the same as on live.


texts: How to style email template in magento2?

texts:
How to style email template? I want to override email variable value and change style according without element inline style used. Is there possible to complie email's less files with grunt.

How to compile email style?


texts: Magento jQuery Image Scaling issue, image not resizing

texts:
We have just moved to a new server & we have around 800+ cms pages with images. Some of the pages have images where we have used tag to specify the width & height, but the issue is the images are coming across with original size. While testing we could presume that the images are not scaling because of jquery, though we have used noConflict() but of no use. We are using Jquery-2.1.1.

Please advise me on how can we resolve the issue & make the image load in required size. As editing each page will be a tiring job to do.

Thanks


texts: In Magento 2 how can i keep shipping address same as billing address ?

texts:
I don't want to give choice to customer different shipping address than the billing address.
I want user should  add billing address and it should be same for shipping.
I don't want to give choice user to select different shipping address.
Could any one just give me way to complete this ?

Thanks in advance.


texts: How to merge CSS files in via config file magento 2

texts:
How I can merge CSS files using the app/etc/config.php file in magento 2? I want to enable this so I can improve the loading times of my website.

What's the right code to achieve this?


texts:
I switched my Site to production mode and enabled JavaScript minification, bundling and concatenating in the backend, expecting Magento to correctly create the .min.js files - It won't, though. First I thought there might be something wrong with the webserver config, but looking at the filesystem, there simply were no minified versions of the scripts.

I did the following (in vain) to resolve:

Deploy static content again
Run upgrade and Di:compile commands
Flush all caches
Clean the var/cache and pub/static directories
Cleared the JavaScript/CSS-Cache in admin
Run bin/magento deploy:mode:set production again

So I switched back to non-minified, non-bundled scripts, resulting in Magento loading an insane amount of individual files, taking ages for it.
How do I get this (absolutely basic) feature to work? *grumble *

I know this gets asked pretty often here, but most of the questions deal with files being written to disk, incorrect permissions or development mode.


texts:
I am using windows 10 and xampp . Installation keep stuck at 0%. Some of the tables are created in database (30 or something). these are the errors that shown in the apache 2 error log

[Sun Feb 16 13:00:00.864775 2020] [mpm_winnt:notice] [pid 9652:tid 260] AH00354: Child: Starting 150 worker threads.
[Sun Feb 16 13:00:04.191132 2020] [mpm_winnt:notice] [pid 11932:tid 648] AH00428: Parent: child process 9652 exited with status 3221226356 -- Restarting.
[Sun Feb 16 13:00:04.634088 2020] [mpm_winnt:notice] [pid 11932:tid 648] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9 configured -- resuming normal operations
[Sun Feb 16 13:00:04.634088 2020] [mpm_winnt:notice] [pid 11932:tid 648] AH00456: Apache Lounge VC14 Server built: Jul  9 2017 11:48:22
[Sun Feb 16 13:00:04.634088 2020] [core:notice] [pid 11932:tid 648] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Feb 16 13:00:04.639089 2020] [mpm_winnt:notice] [pid 11932:tid 648] AH00418: Parent: Created child process 1404
[Su


texts: Save form data in magento 2 custom table

texts:
This is my Admint.phtml file. This form is in admin dashboard need to save the contents in new custom db.

  <form action="/">

      <input type="radio" value="None" id="cash" name="account" checked/>
      Cash
      <input type="radio" value="None" id="percentage" class="radioper" name="account" />
      Percentage
      <input type="text" name="name" id="name" placeholder="Value" class="amttxt" required/>

      No of days to enable cashback:

      <input type="text" name="name" id="name" placeholder="Enter Days" class="dayss" required/>

      <input type="submit" class="btn btn-primary" value="SUBMIT">

  </form>


texts: Fatal error: Class 'Varien_Data_Collection_Filesystem' when taking backup

texts:
We kept the scheduled backup in night.

but when we checked this , we are getting an error under System > Tools > Backup

  Fatal error: Class 'Varien_Data_Collection_Filesystem' not found in /app/code/core/Mage/Backup/Model/Fs/Collection.php on line 35

We have checked in var folder, there also no backup folder.


texts:
I need to remove duplicate product photos after an import. Thumbnails were imported as product photos.

The thumbnail filename is based off the main images filename, so I have:

  fg60-2.jpg
  fg60-2t.jpg

I need a query to look at each products images, and when it finds a product with images like:

  xxxx.jpg
  xxxxt.jpg

Then the xxxxt.jpg image is removed.

Any MySQL experts have any advice? Were using Magento 1.7


texts: Multiple Add to Cart buttons on Custom PHTML file

texts:
So right now I'm creating an add to cart button on a custom PHTML file to create a special landing page using the following code:

<?php

$cartHelper = $this->helper('Magento\Checkout\Helper\Cart');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load(590);

?>
    <form data-role="tocart-form" action="<?php echo $cartHelper->getAddUrl($product); ?>" method="post">
        <?php echo $block->getBlockHtml('formkey')?>
        <button type="submit" title="Add to Cart" class="btn action tocart primary">
            ADD TO CART
        </button>
    </form>

This seems to work fine. I realize that using Object Manager is not going to be ideal, however I've tried everything else under the sun and this is the only thing that works. Most other solutions don't even explain how you set the specific Product ID that's getting added.

Even though this works fine we are now working on a page that has multiple products displayed on the same page. The problem here is that all the Form links go to the same product URL. So whatever is set first all the links end up adding the same product to the cart even though I redefine those variables. The page is made up of multiple PHTML files for different blocks to make it easier to program. The strange thing is that about half way down the page the links change to reference a URL in one file, but then they are all that new Product ID for the rest of the page.

I've even tried using:

$product5 = $objectManager->get('Magento\Catalog\Model\Product')->load(590);
$product6 = $objectManager->get('Magento\Catalog\Model\Product')->load(591);
$product7 = $objectManager->get('Magento\Catalog\Model\Product')->load(349);

And it won't matter even with Unique variable names they come back all as product ID 590


texts: Call to a member function on a non-object

texts:
I keep getting the following error :

  PHP Fatal error:  Call to a member function setCollectShippingRates()
  on    a non-object in
  /chroot/home/Client/Client.com/html/app/code/local/Company/Checkout/controllers/OnepageController.php
  on line 12

I don't know if its something to do with $result or setCollectShippingRates() ? Maybe Varien Data somehow? Thanks for the help.

app/code/local/Company/Checkout/controllers/OnepageController.php

require_once'app/code/local/Mage/Checkout/controllers/OnepageController.php';

class Company_Checkout_OnepageController extends Mage_Checkout_OnepageController
{
    public function couponAction()
    {
        $this->loadLayout('checkout_onepage_review');
        $this->couponCode = (string) $this->getRequest()->getParam('coupon_code');

        Mage::getSingleton('checkout/cart')->getQuote()->getShippingAdress()->setCollectShippingRates(true);
        Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode(strlen($this->couponCode) ? $this->couponCode : '')-> collectTotals()->save();

        $result['goto_Section'] = 'review';
        $result['update_section'] = array('name' => 'review', 'html' => $this->_getReviewHtml());

        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
    }
}


texts: Wrong media URL in WYSIWYG editor when adding images in various Magento store views

texts:
I will try to explain a strange behavior (maybe bug) when using WYSIWYG editor in Magento 1.9.

Magento setup

One website with three store views. Each store view is on different domains. For this case let’s focus only on two storeviews:

storeview 1:  mywebshop.eu
storeview 2:  mywebshop.it

Steps for reproducing the error.

SCENARIO 1 which is OK.

Open desired product, and open WYSIWYG for description field. Select storeview 1 (english)
Add an image (using the editor’s button Insert/Edit image).
The Html code I get is ok like this:

  img src="{{media url="wysiwyg/adobe-pdf-icon-02.png"}}" /

The image is corectly displayed in frontend like this:

SCENARIO 2 which is not OK.

RE-Open the same desired product and open WYSIWYG for description field. (Now select store view 2 (Italian)
Add an image (using the editor’s button Insert/Edit image).
Now the code I get is like this:

  img src="{{media url="https://mywebshop.it/media/wysiwyg/adobe-pdf-icon-02.png"}}" /

The image in frontend is broken, because the HTML output is like this:

RESULT: the image is not displayed because of malformed img src.

We have recently setup Magento that each store view has a different domain. (Maybe this affects).

I saw very similar question here --> Wrong URL returned by WYSIWYG editor for images

But this answer doesn't help/work  (Wrong URL returned by WYSIWYG editor for images)

Please help.


texts:
I'm searching for info about difference between "Admin" and "Adminhtml" scope in magento config files (EX: in some etc/config.xml node ).

I think the scope of "Adminhtml" is the Presentation & Business Logic of the Magento "Admin Panel" but i'm not able to find some scope for "Admin"


texts:
I'm trying to setup a rule that gives a free product every 5 buyed.
This work if I add 5 products to the cart --> grand total is correctly reduced

But if I add 10 or more products the total amount of cat is reduced only by the price of 1 product.


texts: Is typehinting in an extension best practise?

texts:
I often use type-hinting when creating things like observers eg.

public function obsSalableAfter(Varien_Event_Observer $observer)

I've found this to be a useful notation to developers if docblocks are missing, as well as obviously the underlying benefits to PHP.  However, I came up against a problem yesterday, where I installed an extension into an existing store, and it had a type-hinted a specific function.  It turns out, something in the shop I'd inherited was already over-riding this, and PHP was throwing an error due to the mis-matched type.

So, that got me thinking - is type-hinting of any kind good in extensions that are being released to work across multiple stores, since you don't know anything about the target enviornment?


texts: Description on Product page disappears after update to 1.9.2

texts:
I recently upgraded Magento core from 1.9.0.0 to 1.9.2 and noted a few changes to the rwd theme. The least welcome of these was that the Description/Additional Information/Reviews section of the Product page disappeared entirely. Was this a deliberate change? Even if it was, how do I get them back? Can anyone help?

UPDATE: After researching adding a block to a page using a local.xml file for something else I was doing, I wondered if I could just add this block back in the same way. Here's what I put in my local.xml:

<layout>
    <catalog_product_view>
        <reference name="content">
            <block type="catalog/product_view_description" name="product_view_description" after="product_view_media" template="catalog/product/view/description.phtml" />
        </reference>
     </catalog_product_view>
 </layout>

This doesn't work, which probably isn't surprising given that it is the result of a certain amount of guesswork. Am I totally barking up the wrong tree? Or is there a simple error that I could correct to get this working?


texts: "Undefined Index Notice" in EavAttribute.php when adding a swatch option

texts:
I am using Magento 2 and I created an attribute called hair_color that is of a visual swatch input type. I have inputted 140 swatch options for this attribute, but on the 141 I keep getting this error:

  Notice: Undefined index: option_141 in
  /var/www/html/magento2/vendor/magento/module-swatches/Model/Plugin/EavAttribute.php
  on line 177

I am having difficulties figuring out what is the issue since I am using the admin interface to do this.


texts: Where all controller frontnames are stored?

texts: Suppose I've action URL abc/index/save and frontname abc is defined in my config file. When I hit abc/index/save it calls my action method. Where all frontname informations are stored? Does it searches for the given frontnames through config.xml file of all Magento modules? I just wanted to know about the flow, if it searches for the frontname through config file of all modules then it might take some time to search for the given one and load contents accordingly?


texts: Magento2.3.1 : multiselect attribute values is not saving for products via magento backend

texts:
I have tried to save multiple values of an attribute for a product, but it is not saving.
I have used Pipe separator and comma separator, unfortunately, both are not working
Please find my csv file here


texts: How can I render a tooltip / hint button in Magento 2 Module Configuration?

texts:
How can I create a tooltip button in the configuration section of a custom module? Is it possible to use UI Components to define it?

What I'd like to achieve is for example

for the field defined in /etc/adminhtml/system.xml

        <field id="xml_filename" translate="label" type="text" sortOrder="15" showInDefault="1" showInStore="1" showInWebsite="1">
            <label>XML Filename</label>
        </field>

to add a hint

The file will be saved under directory ..... etc etc

I haven't noticed any such hints in other default magento modules' configuration tabs for reference.


texts: Non-existent zip code but still get shipping methods

texts: Can someone explain to me why for a non-existent zip I still get shipping methods. Let's say I choose US, Florida and 32005. Using a service I get that zip code is not found but in Magento I can get an estimation shipping cost. Is it wrong to just tell that zip is wrong or should I leave it like it is now?


texts: Magento\Framework\Filesystem\Driver\File doesn't work in Cron Job Magento 2

texts:
Does any one know why $this->driverFile->isExists('pub/media/') doesn't work in Cron Job ?
I've a Cron Job look like this:
<?php

namespace Namespace\Module\Cron;

use Namespace\Module\Helper\Data;

class Scan
{
    public function __construct(
        Data $helperData,
    ) {
        $this->helperData = $helperData;
    }

    public function execute()
    {
        $data = $this->helperData->scanFiles();
        // do something
    }
}

and a Helper call to $this->driverFile->isExists('pub/media/') but it return false when pub/media/ is actually exists and run manual by Controller still return true (i mean only Cron Job have this issue):
<?php

namespace Namespace\Module\Helper;

use Magento\Framework\App\Helper\Context;
use Magento\Framework\Filesystem\Driver\File as DriverFile;

class Helper extends AbstractHelper
{
    public function __construct(
        Context $context,
        DriverFile $driverFile
    ) {
        $this->driverFile = $driverFile;
        parent::__construct($context);
    }

    public function scanFiles() {
        $directory = 'pub/media';
        if ($this->checkIfFileExists($directory)) {
            $files = $this->driverFile->readDirectoryRecursively($directory);
            foreach ($files as $file) {
                $fileSize = $this->driverFile->stat($file)['size'];
                // do something
            }
        }
    }

    public checkIfFileExists($directory) {
        return $this->driverFile->isExists($directory) && $this->driverFile->isReadable($directory);
    }
}

Thanks for reading.


texts: How to Apply shopping cart rule for group products if there child products are not in same category in magento 1.9

texts:
I want to apply shopping cart price rule on category but that category have group products and there child products are not in same category. when i apply rule on group products then after i add product on cart i cant see discout because child products are not in this category.
so how can i do that if i apply rule on category then aule aplly on chlid products also whether they are not in same category.


texts: Magento2.2.x How to remove a field filter from collection?

texts:
I am loading a collection:

$model = $this->_objectManager->create('Test\Demo\Model\Book');
$collection = $model->getCollection();
$data = [regionCode => 111,regionCode=>222];
foreach ($data as $address) {
$collection->addFieldToFilter(
            'region', array(
                'eq' => $address['regionCode']
            )
        );
    if($collection->getSize()){ /* ex - 111 region available and 222 is not so both time collection getSize() - 1 */
       $model->setData('region',$address['regionCode']);
       $model->save();
       $collection->getSelect()->reset(\Magento\Framework\DB\Select::WHERE);
    }
}

How can I remove this (or all) filter from the collection again? I don't want to load a new collection every time the filter changes.

I tried also

$collection->resetData();

But that doesn't seem to have any effects on the filter.


texts: Backend Product "General" tab disappearing

texts:
Disclaimer: I'm not having quite the same problem as described here

What I've done is add an Attribute using Stores > Attributes > Product. In there I entered a name, changed Storefront Properties > Visible on Catalog Page ... > Yes and saved the Attribute.

I then added edited the default Attribute Set in Stores > Attributes > Attribute Set, created a new Attribute Group, drag/drop the previously created Attribute and saved.

Now whenever I go to a Product page in the backend (edition/creation), the General tab is gone. The only way for me to see it is to delete the Attribute Group.

Has anyone already experienced this? If so, what's the procedure to follow?


texts: Magento Em megaMenu extension not linking categories

texts: I'm using em mega menu extension for my project . mega menu is working fine but its not linking products .


texts: Magento 2 I want to run below command line for every minutes

texts:
I'm using Magento 2.3, Here when create bulk action from product grid schedule not started and updated.
I got solution for the above issue when I run this command above issue fixed. So I want to run this command or every minutes,

php bin/magento queue:consumers:start product_action_attribute.update --max-messages=20

Is there any way to run this command pro-grammatically from my controller?

Thanks in advance.


texts: Programmatically set start_datetime for recurring profiles

texts: I want to set start_datetime for a recurring profile programmatically to the first day of the next year. how can i archieve this? thanks!


texts:
I executed the upgrade from the Magento backend, but the update process hang on setup:upgrade, which give me the following error:

Now the frontend is down and I cannot login to backend.
I tried to execute this command without success:

/bin/magento setup:upgrade


texts: How to get checkout cart data ? Magento2

texts:
$itemsVisible and $items return 0, only $itemsCollection not empty, but this doesn't work in foreach , thanks for help

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// get quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();

// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

// get quote items array
$items = $cart->getQuote()->getAllItems();

$itemsVisible = $cart->getQuote()->getAllItems();

 // get quote items array
 $items = $cart->getQuote()->getAllVisibleItems();

 foreach($itemsCollection as $item) {

    echo 'ID: '.$item->getProductId().'
';
    echo 'Name: '.$item->getName().'
';
    echo 'Sku: '.$item->getSku().'
';
    echo 'Quantity: '.$item->getQty().'
';
    echo 'Price: '.$item->getPrice().'
';
    echo "
";
}


texts:
I have tried ALL THE TECHNIQUES here, and I still cannot figure out how in Magento 1.9 I can get the javascript to not load above the fold, or after the page has loaded.

My website is dev.shielo.com

this is the page speed error i am getting from google:

58 / 100Speed

Should Fix:
Eliminate render-blocking JavaScript and CSS in above-the-fold content
Your page has 1 blocking script resources and 3 blocking CSS resources. This causes a delay in rendering your page.
None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.
Remove render-blocking JavaScript:
http://www.dev.shielo.com/…a/js/1baca94bb0796b5af64534b31746847a.js


texts:
Everything works fine in development mode. But when I switch to production everything except homepage works. The only thing shown is this:
An error has happened during the application run. See exception log for details.

There is nothing written in var/log/exception.log at the time of homepage loading. So I am clueless as to why is this happening.


texts:
How do I change the images in the homepage in CMS? Thank you.

http://siteground121.com/~mataano2/index.php/


texts: Integrate CMS Pages and Others to the Main Menu

texts:
I think this is a quite common problem: There are normal products categories but also some additional CMS pages which could be included in the main shop navigation.

In some shops I have seen the solution, that content was put in a CMS block and the category switched to "display only CMS" block to resemble a navigation for the shop content.

But I do not think that this is a best practice.

Are there better workarounds in Community Edition? (I know there is a Enterprise Edition feature to do this).

Or is there a well-known open source module helping with that?


texts:
I have situation
I want to join two tables having some data related to orders.One table contain order id as increment_id and other table contain order id as order_id.I am joining the tables through customer_id.Now the thing is when we display the column in backend grid we define some column name to it.But now I have two columns containing different names.Then how I can use data of both the column together and can give name to grid column.
Till now my join code is

$collection = Mage::getModel('creditlog/creditlog')->getCollection();
        $collection->addFieldToFilter('main_table.customer_id', $this->getRequest()->getParam('id'));

        $logTable = Mage::getSingleton('core/resource')->getTableName('creditlog/logdata');

        $collection->getSelect()->join(array('a'=> $logTable),
       'main_table.customer_id = a.customer_id', array('order_id','credit_amount','date','status'));

And my grid column is

$this->addColumn('increment_id', array(
            'header' => Mage::helper('creditlog')->__('Your orders'),
            'index' => 'increment_id',
            'type' => 'text',
                )
        );

Please help.


texts:
I'm currently working on Megamenu on Magento 2.3, I'm able to edit menu on chrome but after coming to Firefox I'm not able to edit it and I'm getting error in the console it says ReferenceError: getTemplate is not defined.

So how to resolve this issue?


texts:
When we run static content deployment command I am getting error
Please find the attached image


texts:
I want to use the demo store notice as a ANNUAL LEAVE notice, however when I go into the notices.phtml file, and update it, the site doesn't display the new message.

I have tried refreshing cache, clearing cache and even manually deleting the cache and session files

Any help would be greatly appreciated...

Thanks


texts: Tax not calculated for new tax rule in admin?

texts:
Magento 1.7.0.2
I am trying to make the tax calculation work for products on website level. I created a new tax rate, see https://i.imgur.com/7Ylwx8i.png. Now I created a new tax rule and selected the previously created tax rate, see https://i.imgur.com/Dv7HIeZ.png.
Whenever I open a product and select the scope and the new tax class, the price is shown without tax, see https://i.imgur.com/u08YCjR.png.
The origin is set to France for that scope, so that cant be the problem. Am I missing something here?
Thanks


texts: I want to ignore validate hidden text field when submitting the form

texts:
I want to ignore validate hidden text field before submit form( when submit button clicks).
I have searched for solutions and reached this script. But it is not working, form is submitting before validation fires.

require([
    'jquery',
    'mage/mage'
], function($){

    var dataForm = $('#form_2');
    var ignore = '.field-12-other'; // class name of hidden input text field

    /*
        dataForm.mage('validation', {
            ignore: ignore ? ':hidden:(' + ignore + ')' : ':hidden'
        }).find('input:text').attr('autocomplete', 'off');
        */

         dataForm.mage('validation', {
            ignore: ':hidden:(' + ignore + ')'
        }).find('input:text').attr('autocomplete', 'off');

});

please help me


texts:
I have category structure like this.

Shirts:

Male.
Female.

Pents:

Male.
Female.

What I'm trying is get the category ID by giving passing the parameter like 'Petns/Male' or something like this. I spent an almost complete day to find a solution but didn't get any help.

Looking forward to Hint/Solution.

Thanks


texts: Magento2 - Why Varnish is better the Full Page caching in Magento2

texts:
Magento2 officially recommend to use Varnish on production as it's much faster than the built-in cache, but they don't describe why it's better than the Full Page cache and what are the missing elements,

so can anyone describe what are those things which are missing in Magento2 built inn cache and are available in Varnish? What are the core differences between these two caching mechanisms in Magento? >


texts: Wysiwyg can't translate image url to real path in editor

texts:
Editor after insert image

After click button show editor to view image

Path image was lost. Found this problem when edit content and insert image in catalog product. How to fix it or anyone can tell me exactly where code/js related to this problem

Using magento 2.1.3


texts: Efficient way to get all simple products from large list of configurables?

texts:
I have categories which contain a very large number of configurable products, and I need to load data from each of those products' child (simple) products on the category page (catalog/product/list.phtml).

The problem is, only the configurable products are merchandised into the category. The simple child products are not assigned to any category, so the following code doesn't work:

// Only loads the configurables
$products = Mage::getSingleton('catalog/category')->load($categoryId)
           ->getProductCollection()
           ->addAttributeToSelect('*');

My current method, therefore, is to loop through each configurable and load its child products using code like this:

foreach ($configurableProducts as $configurable) {
    $childProducts[] = $configurable->getTypeInstance(true)->getUsedProducts(null, $configurable);
}

However, this is horribly slow.

Is there a method whereby I can quickly load the simple products, given a large list of configurables?


texts:
I am trying to create before plugin for SubmitQuote method of Magento\Quote\Model\QuoteManagement but plugin is not hitting.

Its a api req so i have declared the plugin in /etc/webapi_rest/di.xml.

The declaration is as follows:

public function beforeSubmitQuote(\Magento\Quote\Model\QuoteManagement $subject, \Magento\Quote\Model\Quote $quote, $orderData = []){
//***Code Here****
}

Please help me to find the reason why its not hitting.


texts: Admin login issue-Invalid Form Key. Please refresh the page

texts: I am facing issue "Invalid Form Key. Please refresh the page" while trying to log-in into magento admin-panel.I know there are many queries went on the same topic but none helped me out.This is happening to me only in my staging site and that too happened when I created staging site using production.Live site's URL is www.xyz.comStaging site's URL is staging.xyz.comThere may be a case of cookie conflict but not sure. Helping hands are most welcome!


texts: Get street address in checkout page magento 2?

texts:
Hello all I am trying to get selected shipping address from dropdown(without changing the dropdown option like getting selected shipping address when page loads) or default shipping address on checkout page. On implementing my functionality in

app\design\frontend\Company\porto_base_child\Magento_Checkout\web\js\view\shipping-information-mixin.js

define(['Magento_Checkout/js/model/quote', 'jquery',
'mage/translate',], function (quote,$) {
    'use strict';

    var mixin = {

        isPickup: function() {
            var shippingMethod = quote.shippingMethod();
            if (shippingMethod === null || shippingMethod === undefined) {
                return false;
            }
            if (shippingMethod.carrier_title === null || shippingMethod.carrier_title === undefined) {
                return false;
            }
            return (shippingMethod.carrier_title === "Toronto Customer pick-up");
        }
    };

    return function (target) {
        /**Code below checks if the default shipping address or the slected shipping address has pobox in dropdwon shipping address select on Checkout page*/
        console.log(quote);
        console.log(quote.shippingAddress());
        var convertstreet = quote.shippingAddress().street.toString();
        var pattern = /((((p[\s\.]?)\s?[o\s][\.]?)\s?)|(post\s?office\s?))((box|bin|b\.?)?\s?((num|number|no|#)\.?)?\s?\d+)/igm.test(convertstreet);

        if(pattern== false)
        {
            document.getElementById('opc-shipping_method').style.display='block';
            document.getElementById('poboxmessage').style.display='none';
        }
        else{
         document.getElementById('opc-shipping_method').style.display='none';
         document.getElementById('poboxmessage').style.display='block';
         document.getElementById('poboxmessage').innerHTML=$.mage.__(document.getElementById('poboxmessage').innerHTML);
        }
         return target.extend(mixin);
    };
});

But I am getting an error saying Uncaught TypeError: Cannot read property 'street' of null on (var convertstreet = quote.shippingAddress().street.toString();).

I am not sure is this the best way to get the street address from quote but I am still trying to figure out any better solution to get the street address from either default shipping address or selected shipping address from dropdown(without changing the dropdown option like getting selected shipping address when page loads). It would be really helpful if I can get some advice or suggestion so that I can understand the concept how quote works? thanks


texts: What is an adapter and what is its functionality in magento core files? Can someone explain the concept?


texts:
I would like to get a table in the administration which i have the invoices pending from a date

so I create a class with _prepareCollection () function.

In the function I added this statement:

   $now = Zend_Date::now();
   $collection->addAttributeToFilter('dunning_payable_due_on',array('date' => true, 'to' => $now));
   $collection->addAttributeToFilter('state','1');

but I get an error:

Integrity constraint violation: 1052 Column 'state' in where clause is ambiguous

I have to do a join but I don't know with what table.

thanks for your help.


texts:
I have a magento site hosted on a hostgator shared plan. It only allows me to run cron jobs which are more than 15 mins. I have used the following format to run the cron job.

*/15    *   *   *   *   php /home/username/public_html/path/cron.php

Still my 'cron_schedule' table is empty. I have also set the cron.php file permission to 755. (Magento ver. 1.9.2.1)

====Update=====

Contacted hostgator, They ran the script manually and still the 'cron_schedule' table is empty.


texts: How to call Magento2 mview reindexer programmatically

texts:
I have line of code which schedule full or partial reindex cron job.

using Trigger::REINDEX_SCOPE_PARTIAL and Trigger::REINDEX_SCOPE_FULL parameter.

public function restoreIndexers($reindex = false, $indexers = null, $threshold = null)
{
    foreach ($this->prepareCodesForReindex($indexers) as $code) {
        $previousMode = $this->indexerModes[$code] ?? null;

        if (\is_null($previousMode)) {
            continue;
        }

        try {
            /** @var \Magento\Framework\Indexer\IndexerInterface $indexer */
            $indexer = $this->getIndexerByCode($code);
            $currentMode = $indexer->isScheduled();
            $indexer->setScheduled($previousMode);
            $this->indexerModes[$code] = null;

            if (\is_array($reindex)) {
                $this->scheduleReindex($code, Trigger::REINDEX_SCOPE_PARTIAL, $reindex, $threshold);
            } elseif ($reindex) {
                $this->scheduleReindex($code, Trigger::REINDEX_SCOPE_FULL);
            }
        } catch (\Exception $e) {
            $this->logger->critical($e, [
                'indexer' => $code,
                'previous_mode' => $previousMode ? 'on schedule' : 'on save',
                'current_mode' => isset($currentMode) ? ($currentMode ? 'on schedule' : 'on save') : 'unset',
            ]);
        }
    }
}

I need to call mview reindexer using this function.
I don't know how can I achieve this. Trigger::REINDEX_SCOPE_MVIEW, and need to add option code under Trigger class. but I am not aware how I can call MVIEW reindexer under scheduleReindex function.

I know very little about this MVIEW reindexer.
Can anyone please provide a suggestion?


texts:
I am using Magento 2.2.6. In my custom module I add catalog_category_view.xml add a block

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="sidebar.main">
            <block class="Vendor\Module\Block\CategoryListing"  name="sidebar.vendor.category" before="catalog.navigation.renderer" cacheable="false" template="Vendor_Module::category_list.phtml"/>
        </referenceContainer>
    </body>
</page>

and class is as

class CategoryListing extends \Magento\Framework\View\Element\Template
{

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context
    )
    {
        parent::__construct($context);
    }

    public function welcome()
    {
        .....
    }
}

but page through error.

Fatal error: Uncaught Error: Call to a member function get() on null in /home/user/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144 Stack trace: #0

But without class in layout xml as

<block name="sidebar.vendor.category" before="catalog.navigation.renderer" cacheable="false" template="Vendor_Module::category_list.phtml"/>

Works fine i.e. load category_list.phtml with its content. But my target is using the block with class.

Where is the problem? Thanks!


texts: magento 2.2.8: mail attachment not working

texts:
I have installed email attachment extension https://github.com/manishjoy1993/email-attachment  in magento 2.2.8 version and it throw some errors. Errors mentioned in following image.
And there are some solutions available on internet but they are for 2.3.x version but I have installed 2.2.8

In magneto 2.2.8,it throw following error

I also installed magento 2.2.3 version,for this I have applied code from webkul

https://webkul.com/blog/attach-pdf-file-magento-2-email/
 This webkul link works fine in 2.2.3 but not in magento 2.2.8


texts: Product Slider in Category page (description field)

texts:
In the Ultimo theme, the manual says to use this code for a product slider:

{{block type="ultimo/product_list_featured"
template="catalog/product/list_featured_slider.phtml" category_id="3" product_count="12"
hide_button="1" block_name="My Products"}}

However, if I put this code in a category page (description field), it just outputs the text.

How can I get this code (or something equivalent) to run in that location?


texts: Magento2.4 use knockout to identify if user is logged in

texts:
I am trying to edit the links in the header.phtml file so that it will show and additional link only if logged in.
My issue is it does not seem to work here is my code. The sign up is showing even when logged in??
<?php
 /**
  * @var \Magento\Theme\Block\Html\Header $block
  */
   $welcomeMessage = $block->getWelcome();
 ?>

About Us

Faq's

Sign Up

    <?= $block->getBlockHtml('header.additional') ?>


texts: Add new column to an EAV table `catalog_product_entity`

texts:
I tried to add new column to the table catalog_product_entity via a setup resource. But when i try to save a value to table (using setMyColumnName()), the value is not reflected in the underlying table.

I understand that this is the wrong way to add a column to an eav table in magento. But i couldn't find any article on howto do this.

NOTE: i don't need to add an attribute to catalog/product. I want to add a field as a column.


texts: How to update product eav attribute in magento 2

texts: I want to update product custom attribute when custom module is upgraded. Attribute code is product_brand and i want to set it's is_used_for_promo_rules to 1. Any help appreciated.


texts: Smooth scroll to top pagination from Ajax extension

texts:
How can I implement smooth scroll to top in a ajax extension that does pagination. The extension has the code following

if (block && amshopby_scroll_to_products) {
    $$('body')[0].scrollTo();
}

and I have following code in my theme phtml which does smooth scroll to top functionality. Is it possible to call this functionality from the extension js file mentioned above.If not what is the the solution to implement?

    var windowScroll_t;
    $(window).scroll(function(){

        clearTimeout(windowScroll_t);
        windowScroll_t = setTimeout(function() {

            if ($(this).scrollTop() > 100)
            {
                $('#scroll-to-top').fadeIn();
            }
            else
            {
                $('#scroll-to-top').fadeOut();
            }

        }, 500);

    });

    $('#scroll-to-top').click(function(){
        $("html, body").animate({scrollTop: 0}, 600, "easeOutCubic");
        return false;
    });


texts: Why Magento2 Admin Panel is too much slow and keeps on loading ?


texts: How to save customer custom attribute default value to all Customers

texts:
I created a custom attribute for the customer entity. I also have the adminhtml_customer form, where the value can be changed and saved.

The problem which I am facing is that, by default for all the customers the custom attribute is not present.

Only once I save it through the admin panel, that it appears as the data for that customer.

So, is there any way I can set a default value for the customer custom attribute which is not there itself by default.

The code which I used to make custom attribute :

<?php

$installer = $this;
$installer->startSetup();
$entityTypeId     = (int)$installer->getEntityTypeId('customer');
$attributeSetId   = (int)$installer->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = (int)$installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$installer->addAttribute( $entityTypeId, 'whatsapp_status', array(
    'type'               => 'int',
    'label'              => 'Whatsapp Status',
    'input'              => 'select',
    'forms'              => array('adminhtml_customer'),
    'source'             => 'dbaux_customer/source_whatsappOption',
    'required'           => false,
    'visible'            => 1,
    'default'            => 'Inactive',
    'system'             => 0,
    'user_defined'       => 1,
    'nullable'           => false,
));

$installer->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'whatsapp_status',
    '999'  //sort_order
);

$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'whatsapp_status');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();

$installer->endSetup();

My Source File :

<?php
class Dbaux_Customer_Model_Source_WhatsappOption extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{
    /**
     * Retrieve all options array
     *
     * @return array
     */
    public function getAllOptions()
    {
        if (is_null($this->_options)) {
            $this->_options = array(

                array(
                    "label" => Mage::helper("eav")->__("New User"),
                    "value" =>  0
                ),

                array(
                    "label" => Mage::helper("eav")->__("Opted In"),
                    "value" =>  1
                ),

                array(
                    "label" => Mage::helper("eav")->__("Opted Out"),
                    "value" =>  2
                ),

                array(
                    "label" => Mage::helper("eav")->__("Not Registered"),
                    "value" =>  3
                ),

            );
        }
        return $this->_options;
    }

    /**
     * Retrieve option array
     *
     * @return array
     */
    public function getOptionArray()
    {
        $_options = array();
        foreach ($this->getAllOptions() as $option) {
            $_options[$option["value"]] = $option["label"];
        }
        return $_options;
    }

    /**
     * Get a text for option value
     *
     * @param string|integer $value
     * @return string
     */
    public function getOptionText($value)
    {
        $options = $this->getAllOptions();
        foreach ($options as $option) {
            if ($option["value"] == $value) {
                return $option["label"];
            }
        }
        return false;
    }

}


texts: Magento 2: How to override model resource configurable file

texts:
I have created a custom module.

di.xml

  < type
  name="Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable">
           < plugin name="ptgConfigurableProduct" type="ModuleName\Extendfiles\Plugin\Model\ResourceModel\Product\Type\Configurable"
  sortOrder="1" />    < /type>

Path: /ModuleName/Extendfiles/Model/ResourceModel/Product/Type/
Configurable.php

  namespace
  ModuleName\Extendfiles\Plugin\Model\ResourceModel\Product\Type;

  class Configurable extends
  \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable
  {

  }

Function

  public function afterGetAttributeOptions($superAttribute, $productId){

    $scope  = $this->getScopeResolver()->getScope();
    $select = $this->getConnection()->select()->from(
        ['super_attribute' => $this->getTable('catalog_product_super_attribute')],
        [
            'sku' => 'entity.sku',
            'product_id' => 'product_entity.entity_id',
            'attribute_code' => 'attribute.attribute_code',
            'value_index' => 'entity_value.value',
            'option_title' => $this->getConnection()->getIfNullSql(
                'option_value.value',
                'default_option_value.value'
            ),
            'default_title' => 'default_option_value.value',
        ]
    )->joinInner(
        ['product_entity' => $this->getTable('catalog_product_entity')],
        "product_entity.{$this->getProductEntityLinkField()} = super_attribute.product_id",
        []
    )->joinInner(
        ['product_link' => $this->getTable('catalog_product_super_link')],
        'product_link.parent_id = super_attribute.product_id',
        []
    )->joinInner(
        ['attribute' => $this->getTable('eav_attribute')],
        'attribute.attribute_id = super_attribute.attribute_id',
        []
    )->joinInner(
        ['entity' => $this->getTable('catalog_product_entity')],
        'entity.entity_id = product_link.product_id',
        []
    )->joinInner(
        ['entity_value' => 'catalog_product_entity_int'],
        implode(
            ' AND ',
            [
                'entity_value.attribute_id = super_attribute.attribute_id',
                'entity_value.store_id = 0',
                "entity_value.{$this->getProductEntityLinkField()} = "
                . "entity.entity_id",
            ]
        ),
        []
    )->joinLeft(
        ['option_value' => $this->getTable('eav_attribute_option_value')],
        implode(
            ' AND ',
            [
                'option_value.option_id = entity_value.value',
                'option_value.store_id = ' . $scope->getId(),
            ]
        ),
        []
    )->joinLeft(
        ['default_option_value' => $this->getTable('eav_attribute_option_value')],
        implode(
            ' AND ',
            [
                'default_option_value.option_id = entity_value.value',
                'default_option_value.store_id = ' . \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
        ),
        []
    )->where(
        'super_attribute.product_id = ?',
        $productId
    )->where(
        'option_value.value != "N/A"',
        $productId
    )->where(
        'attribute.attribute_id = ?',
        $superAttribute->getAttributeId()             $attributeId
    );

  return $this->getConnection()->fetchAll($select);
  }

Getting below error for this code

  $superAttribute->getAttributeId()

,
Fatal error: Call to undefined method Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Interceptor::getAttributeId()


texts: Declaration warning when extending _afterLoad() in AbstractModel

texts:
I've created a backend module to which I've added the possibility to set storeview specific data today. That worked and showed up fine. So I'm trying to load and save my storeview data now but it just won't work. I took the code from this answer and I'm using Magento 2.3.3.

Here is my Model code in which I'm trying to load and save the storeview settings:

<?php

namespace Company\Module\Model;

use Magento\Framework\Model\AbstractModel;

class Module extends AbstractModel
{
    /**
     * Define resource model
     */
    protected function _construct()
    {
        $this->_init('Company\Module\Model\ResourceModel\Module');
    }

    /**
     * @param \Magento\Framework\Model\AbstractModel $object
     * @return void
     */
    protected function saveStore($object)
    {
        $condition = $this->getConnection()->quoteInto('item_id = ?', $object->getId());
        $this->getConnection()->delete($this->getTable('company_module_store'), $condition);
        foreach ((array)$object->getData('store_id') as $store) {
            $storeArray = [
                'item_id' => $object->getId(),
                'store_id' => $store,
            ];
            $this->getConnection()->insert(
                $this->getTable('company_module_store'),
                $storeArray
            );
        }
    }

    /**
     * @param \Magento\Framework\Model\AbstractModel $object
     * @return $this
     */
    protected function _afterSave(AbstractModel $object)
    {
        if (!$object->getIsMassStatus()) {
            $this->saveStore($object);
        }

        return parent::_afterSave($object);
    }

    /**
     * @param \Magento\Framework\Model\AbstractModel $object
     * @return \Magento\Framework\Model\AbstractModel
     */
    public function loadStore(AbstractModel $object)
    {
        $select = $this->getConnection()->select()
            ->from($this->getTable('company_module_store'))
            ->where('item_id = ?', $object->getId());

        if ($data = $this->getConnection()->fetchAll($select)) {
            $array = [];
            foreach ($data as $row) {
                $array[] = $row['store_id'];
            }
            $object->setData('store_id', $array);
        }

        return $object;
    }

    /**
     * @param \Magento\Framework\Model\AbstractModel $object
     * @return $this
     */
    protected function _afterLoad(AbstractModel $object)
    {
        if (!$object->getIsMassDelete()) {
            $this->loadStore($object);
        }

        return parent::_afterLoad($object);
    }
}

When I load this in backend I get:

  Exception #0 (Exception): Warning: Declaration of Company\Module\Model\Module::_afterLoad(Magento\Framework\Model\AbstractModel $object) should be compatible with Magento\Framework\Model\AbstractModel::_afterLoad()

I guess the problem is that _afterload originally doesn't accept any arguments? But then how can I solve my problem? Really at a loss here.


texts: Magento 2 Programatically create a product on the checkout_cart_product_add_after event

texts:
I'm currently working on a module that adds specific products to the cart when the customer adds a normal product. I created an observer for the checkout_cart_product_add_after. The user will select a few options which will be posted and this observer will form a sku with that, get the specific product and add it to the cart.

The problem is that sometimes a product with the formed sku might not exist, so I want to create and then add it to the cart. I've tried a few things, but it doesn't seem to work.

Here is the code I currently have, which adds the specific products to the cart.

Thanks for the help.

    // Get the custom variations values added through the VariationsInput block.
    $post = $this->_request->getParam('variations');

    // Create the custom sku.
    $customSku = 'SV';
    foreach ($post as $key => $value) {
        if ($key == '' || $value == '') {
            continue;
        }
        $customSku .= $value;
    }

    // Get the current product the user is trying to add to cart.
    $currentProduct = $observer->getEvent()->getData('product');
    // Get the additional product that needs to be added to cart.
    $productToAdd = $this->_productRepository->get($customSku);

    // Here is the part where I need to check if the product doesn't exist and then create it.
    if (empty($productToAdd)) {
        //Code to create the product and assign it to the $productToAdd variable.
    }

    // Enter the id of the prouduct which are required to be added to avoid recurrssion
    if ($currentProduct->getId() != $productToAdd->getId()) {
        $params = array(
            'product' => $productToAdd->getId(),
            'qty' => $currentProduct->getQty()
        );
        $this->_cart->addProduct($productToAdd, $params);
        $this->_cart->save();
    }


texts: Magento 2.3: Why do HTML tags manually added in Magento content editor for an CMS page disappear?

texts:
To add an image in the AMP home page, I replaced the img tag with amp-img as follows.

<amp-img style="display: block; margin-left: auto; margin-right: auto;" src="/images/5f83940c725da.jpg" width="320" height="180" layout="responsive"></amp-img>

Although this line ensures mobile visitors can view our store's homepage with the above image, I don't now see the line of code above on revisiting the Editor button`.
What I see now is
 leaving me wondering what causes the loss of previously added tags.
Can any please tell why this happens?


texts: How to show tax percentage for current product in magento?

texts: I have tried many way but i can't get the solution. How to show current product tax percentage in magento 2?


texts: Magento 2 - Custom admin theme not working in production mode

texts: I create a custom admin theme to override few admin template files. In developer mode theme work perfect, but when I turn on production mode and make: bin/magento setup: static-content: deploy then: bin/magento cache: flash theme not work. In DB theme is registered. When I check pub/static/adminhtml/custom_module/custom_module there are no files.


texts: Magento totals on emails and PDF invoices with coupon applied

texts:
TAX settings in the system
Tax settings: there is a 5% tax for the product and 25% tax for the shipping configured in the system.

Emails and invoices are set to display with both Included and Excluded taxes, and with full tax summary.
Subtotal is not displaying neither on cart, nor emails nor invoices.

There is a fixed amount coupon created for the whole cart with the amount of 30.

Description of the problem
When someone activates a coupon on the cart, and finishes order, he gets totals like it is shown below:

Subtotal (Excl.Tax) 180,00
Subtotal (Incl.Tax) 189,00
Shipping & Handling (Excl.Tax)  20,00
Shipping & Handling (Incl.Tax)  25,00
Discount (pl9432)   -30,00
Tax on product (5%)     7,57
Tax on shipping and handling (25%)  5,00
Tax total:  12,57

So actually, all fields are displayed correctly besides there should be one more field Subtotal (with discount applied), and in this case the amount should be 151.43 (159 * 1,05).
We need to add this subtotal with discount applied to emails and PDF invoices.

Every help is welcomed.


texts: Magento hide date when value is 2010-01-01 00:00:00

texts:
I use a custom date attribute to display a date.
By default the attribute does have value 2010-01-01 or does not have any value (empty attribute).

I need are rule that checks if the date is the default value of 2010-01-01 or empty, then it should echo nothing.

Else it should echo some of this code, except the first if rule:

<?php if($_product->getData('nieuwe_voorraad')) : ?>

<?php
$today = Mage::helper('core')->htmlEscape($_product->getData('nieuwe_voorraad'));
$date = Mage::helper('core')->formatDate($today, Mage_Core_Model_Locale::FORMAT_TYPE_FULL, false);
echo $date;
?>

<?php endif; ?>


texts:
when trying to execute dev:test:run integration getting following error

Next Magento\Framework\Exception\LocalizedException: Command returned non-zero exit code:
`mysqldump --defaults-extra-file='/var/www/magento206/dev/tests/integration/tmp/sandbox-0-ca4ee7e931dcd5242e686eaa1575d816/defaults_extra.cnf' --host='127.0.0.1'  'magento_integration_tests' > '/var/www/magento206/dev/tests/integration/tmp/sandbox-0-ca4ee7e931dcd5242e686eaa1575d816/setup_dump_magento_integration_tests.sql' 2>&1` in /var/www/magento206/vendor/magento/framework/Shell.php:62

Through PHPStorm getting this

Exception: Starting Magento uninstallation:
[Zend_Db_Statement_Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.core_config_data' doesn't exist, query was: SELECT `main_table`.`config_id`, `main_table`.`path`, `main_table`.`value` FROM `core_config_data` AS `main_table` WHERE (`scope` = 'default')
[PDOException]
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.core_config_data' doesn't exist
setup:uninstall [--magento-init-params="..."]

Next Magento\Framework\Exception\LocalizedException: Command returned non-zero exit code:
`mysqldump --defaults-extra-file='/var/www/magento206/dev/tests/integration/tmp/sandbox-0-ca4ee7e931dcd5242e686eaa1575d816/defaults_extra.cnf' --host='127.0.0.1'  'magento_integration_tests' > '/var/www/magento206/dev/tests/integration/tmp/sandbox-0-ca4ee7e931dcd5242e686eaa1575d816/setup_dump_magento_integration_tests.sql' 2>&1` in /var/www/magento206/vendor/magento/framework/Shell.php:62

dev/tests/integration/phpunit.xml - is properly pointed
dev/tests/integration/etc/install-config-mysql.php - correctly
configured.


texts: How to set up special offer bundles of products?

texts:
i want to set up some bundle offers for products...
i have read extensively about the different product types of magento but still cant see what i am after...

I am wanting to take 5 or 6 or my existing simple products, bundle them together and create a page all about the offer, and then put an offer price on them if they are bought together...

Any idea how to go about this?

Thanks all


texts: M2 - Overriding model from core module Customer (EmailNotification)

texts:
Can you guys guide me on how to properly do this. I created a module to extend the EmailNotification model but its not working. I'm getting error during compile:

  Interface '[Namespace]\[Module]\Model\EmailNotificationInterface' not
  found in /app/code/[Namespace]/[Module]/Model/EmailNo
  tification.php on line 8

What I'm trying to achieve is to send email notification to admin every time a customer registers. I'm overriding this model just to modify the private function sendEmailTemplate to addBcc when it sends welcome email to the newly registered customer.

  app/code/[Namespace]/[Module]/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <preference for="Magento\Customer\Model\EmailNotification" type="[Namespace]\[Module]\Model\EmailNotification" />
</config>

  app/code/[Namespace]/[Module]/model/EmailNotification.php

<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace [Namespace]\[Module]\Model;

class EmailNotification implements EmailNotificationInterface

Note: I copied everything on EmailNotification.php and just modified some parts.


texts:
When a user clicks 'Create and Account' from the top links, it successfully renders the account creation page.  However, when filling out the details (i.e. 'First Name', 'Middle Name', 'Last Name', Newsletter Checkbox, 'Email', 'Password', and 'Confirm Password').

When clicking the 'Create An Account' button, the following error appears: "Something is wrong".

I have reviewed all of the logs that I can find and cannot find anything indicative to a problem.  I have also confirmed that the email address is not already within the database.  I have also successfully created an account post checkout as guest.

Magento version: 2.2.1


texts:
I have an eshop in Greece and i want to configure its seo settings.

Its important for me to have greek characters in urls.

Althought, it automatically change them into latin characters.

Any idea?


texts:
How to create product page in Magento 2 like here.

When I click on product it goes to 404 error.


texts: How to create admin user for specific store in magento2?

texts:
I have a multi-store website which runs over different domains. I have also a multi-admin user. Now I need to set them for specific stores.

Basically I need admin user who can access data of only of specific store depends upon the settings created by main admin user.

Help me to resolve this.


texts: Magento cookie issue..Customer can't login

texts:
I am facing weird problem that some customer can't login to their account.When customer  try to login ,it redirect to same page without any error.it happens user who visited the site before. And for new user doesn't have any issues.if i clear cookie then everything is fine.These problem started when i shifted to new server which support HHVM.I am not able to find from where it redirects.After login it is going _loginPostRedirect action method and then redirecting to account/indexAction but it is not reaching to the this account/indexAction .Before this action some where it redirect to the login page again.Any one can help me to find from where it redirect or what is the issue with cookie?.

Thanks,
Shabeer


texts:
I'd like to know if I can override a CLI, specifically the bin/magento setup:upgrade.

I want to override the class Magento\Setup\Validator\DbValidator, the method checkDatabasePrivileges.


texts: VERY small Png image not showing in frontend?

texts:
I have looked for an answer with no sucess.

In my 1.7.0.2 Magento I can upload a QR code png image, dimensions 164 x 164, size 400 bytes, it shows fine in the admin area, but will not display in front end (just shows "Loading" forever...).

I have tried different images from the QR code generator, all almost identical size, all fail on frontend.
They do work if I convert them to GIF.

The original Png files DO work on my 1.9 Magento installation (on the same server).

Can anyone suggest why that might be, and how I can fix this?

Regards, Paul


texts: How to Add Custom Tab in Customer Account Dashboard in Magento 2

texts:
I tried to follow steps according to this link: https://magecomp.com/blog/add-custom-tab-in-customer-account-section-magento-2/

The following code actually added a link to navigation bar but the page which should loads on click results 'not found' error

index.php :

<?php
namespace Magecomp\Mycard\Controller\Index;

use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;

class Index extends \Magento\Framework\App\Action\Action
{
protected $resultPageFactory;

protected $session;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Customer\Model\Session $customerSession,
    PageFactory $resultPageFactory
    )
{
    $this->session = $customerSession;
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
    if (!$this->session->isLoggedIn())
    {
        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setPath('customer/account/login');
        return $resultRedirect;
    }
    else
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->set(__('help'));
        return $resultPage;
    }
}

}

module.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magecomp_Mycard" setup_version="0.0.8">
    <sequence>
        <module name="Magento_Customer"/>
    </sequence>
</module>

customer_account.xml :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-mycard" after="-">
            <arguments>
                <argument name="path" xsi:type="string">mycard/customer/index</argument>
                <argument name="label" xsi:type="string">Mycard</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

mycard_customer_index.xml :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<body>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">My Card</argument>
        </action>
    </referenceBlock>
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="my_card" template="Magecomp_Mycard::mycard.phtml">
        </block>
    </referenceContainer>
</body>

mycard.phtml :

<?php
echo "Hello Friends";
?>

registration.php :

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE, 'Magecomp_Mycard',
__DIR__
);

Could anybody help me please?


texts: Custom block/template into cms WYSWIYG editor

texts:
I have problem with inserting custom block/template into cms page editor. If I put the below code to header.phtml it works fine and it displays content inside home page:

echo $this->getLayout()->createBlock('company_slider/slider')->setTemplate('company/slider/slider.phtml')->toHtml();

But if I try to insert this into cms page it won't display anything:

{{block type="company_slider/slider" name="slider_slider" template="company/slider/slider.phtml"}}

I have these lines in extension config file:

<global>
      <blocks>
          <company_slider>
              <class>Company_Slider_Block</class>
          </company_slider>
      </blocks>
</global>

Am I missing anything? I guess paths are correct because it works if I insert block directly to phtml file as shown above.


texts: How do I treat a string attribute as a number when filtering

texts:
When I'm trying to filter products I get weird results, I have created my own search box with the following index controller:

    $params = $this->getRequest()->getParams();

    $collection = Mage::getModel('catalog/product')->getCollection();
    $collection->addAttributeToSelect('name');
    $collection->addAttributeToSelect('womble25');
    $collection->addFieldToFilter(array(
        array('attribute'=>'womble25','gt'=>$params['lbparam']),
    ));
    $collection->addFieldToFilter(array(
        array('attribute'=>'womble25','lt'=>$params['ubparam']),
    ));

    $search = "";
    foreach ($collection as $_product) {
        $search .= " - ".$_product->getName(). " (".$_product->getWomble25().") - <br>";
    }

I input lower as '1' and higher as '20' and get something like the following:

- product A (1132) -
- product B (1719) -
- product C (10456) -
- product D (17025) -
- product E (17.02) -
- product F (1.171) -

Ofcourse I'm expecting only products with womble25 value between 1 and 20...

EDIT:

I found the issue, it is that the attribute womble25 is a string, which it needs to be as it is a value to 4 sf, ie. 0.2300 is valid and the 2 0's are required at the end, so my question is:

How do I treat a string attribute as a number.


texts: How to get logo url using a store id in the backend?

texts:
I'm trying to get url of the front-end logo inside a custom helper method in the backend, but I get stuck on getting a file using theme model. All I have is: store id, theme id, theme model and a filename:

/**
 * Retrieve default store logo image URL from design config or theme
 *
 * @param null $storeId
 * @return string
 */
protected function getDefaultStoreLogoUrl($storeId = null)
{
    $folderName = \Magento\Config\Model\Config\Backend\Image\Logo::UPLOAD_DIR;
    $storeLogoPath = $this->scopeConfig->getValue(
        'design/header/logo_src',
        ScopeInterface::SCOPE_STORE,
        $storeId
    );

    $path = $folderName . '/' . $storeLogoPath;
    $logoUrl = $this->_urlBuilder
            ->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]) . $path;

    if ($storeLogoPath !== null && $this->isFile($path)) {
        $url = $logoUrl;
    } else {
        $themeId = (int)$this->scopeConfig->getValue(
            'design/theme/theme_id',
            ScopeInterface::SCOPE_STORE,
            $storeId
        );
        /** @var \Magento\Theme\Model\ResourceModel\Theme\Collection $themeCollection */
        $themeCollection = $this->themeFactory->create();
        /** @var \Magento\Theme\Model\Theme $theme */
        $theme = $themeCollection->getItemById($themeId);

        // ..... I'm stuck here
    }

    return $url;
}

I need asset for the theme frontend, but I don't know how to access it. It's should be something similar to the Block/Logo's code:

$url = $this->assetRepository->getUrlWithParams(
    'images/logo.svg',
    [
        '_secure' => $this->_request->isSecure()
    ]
);

But inside the backend $this->assetRepository returns a backend asset :( and result url looks like:

http://baseurl.com/pub/static/adminhtml/Magento/backend/en_US/images/logo.svg

when I expect to get url like:

http://baseurl.com/pub/static/frontend/Magento/luma/en_US/images/logo.svg

The question is: how to get the frontend asset for specific theme in the backend?


texts: Magento does not capture a delivery date when customer pays with Paypal

texts:
We use Paypal for all the payment options (customer is forwarded to the Paypal site to do a PayPal payment but stays within the shopping cart if paying by credit card /still settled by PayPal though/). I installed the Amasty's Delivery Date extension (basically a calendar) which appears on the Shipping step of the order /3 SHIPPING METHOD/ ( https://amasty.com/delivery-date.html )

I selected that customer MUST fill out the delivery date (it is mandatory). It works fine except for cases where customers pay with Paypal - then - it does not pass the delivery date back to the order in the Admin or the order Email.

    **It works if the customer pays with a credit card (still processed by Paypal BUT I just noticed that when I click on option #1 (Debit or
    Credit Card) - it stays inside my shopping cart (the customer IS NOT
    forwarded to the Paypal site) - it just opens 4 rows:

>     > 1. Credit Card Type
>     > 2. Credit Card Number
>     > 3. Expiration Date
>     > 4. Card Verification Number

So it must just be when the customer goes to the Paypal site!

Any ideas?


texts: Where to change password validation message?

texts:
When customers attempt to create an account they are currently seeing "Please enter 7 or more characters, using both numeric and alphabetic." as the password validation error message.
I have already changed the validation via regular expression to 8 or more characters containing at least 1 number, 1 uppercase, and 1 lowercase letter.
So, Where can I change the error message to match the criteria?
Thanks,
Rob


texts: How can i add one more extra row in cart page summary section below of shipping

texts:
how to i make the tax amount was only show in cart page and checkout page
i wan to add custome row in that page and that also manage by admin like enable disable

add custome row with custome numeric value in magento2 cart page summary


texts: Can we remove Integration environment from magento cloud project?

texts:
We are having lots of extra code on integration environment. I cannot reset the commits on this branch as there are lots of issues on integration branch. So I wanted to remove integration environment and create new environment which will be the copy of staging.
So how I can achieve this?


texts:
I try to display Product attribute in cart page like this

<?php $_item = $this->getItem()?>
<?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
<?php echo $_product->getResource()->getAttribute('disable')->getFrontend()->getValue($_product); ?>

all product display same value only what mistake i done here ?


texts: how do I override Magento newsletter subscriber?

texts:
I have a hard time to work out the di.xml, I am trying to override a function of this file
vendor\Magento\module-newsltter\Model\Subscriber.php

anyone can tell me what should I do? I think I have problem with create the di.xml and module.xml files
I created below files:
app/code/ABC/NewsletterApi/Model/Subscriber.php
app/code/ABC/NewsletterApi/etc/di.xml
app/code/ABC/NewsletterApi/etc/module.xml
app/code/ABC/NewsletterApi/registration.php

app/code/ABC/NewsletterApi/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Newsletter\Model\Subscriber" type="ABC\NewsletterApi\Model\Subscriber" />
</config>

app/code/ABC/NewsletterApi/etc/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="ABC_NewsletterApi" setup_version="1.0.0"/>
</config>

Subscriber.php
public function unsubscribe()
{
    if ($this->hasCheckCode() && $this->getCode() != $this->getCheckCode()) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('This is an invalid subscription confirmation code.')
        );
    }

    if ($this->getSubscriberStatus() != self::STATUS_UNSUBSCRIBED) {
        $this->setSubscriberStatus(self::STATUS_UNSUBSCRIBED)->save();
        $this->sendUnsubscriptionEmail();
    }
    return $this;
}


texts:
Does anyone know how to tell what the lifetime is in on the enterprise edition full page cache? I've poked around the code base a good bit but I don't see anything that indicates a set lifetime.

Thanks!


texts: Magento 2, add Custom Text Attribute to the Products

texts:
I add a Custom TEXT Attribute (more_info) to my Magento 2 Store and I will show the Value to my product.info.main Page.

I add

mytheme\Magento_Catalog\layout\catalog_product_view.xml

<referenceBlock name="product.info.main">
    <block class="Magento\Catalog\Block\Product\View" template="product/view/more_info.phtml" >
    </block>
</referenceBlock>

and

mytheme\Magento_Catalog\templates\product\view\more_info.phtml

<?php $_product = $this->getProduct(); ?>
    <?php echo $_product->getAttributeText('more_info') ?>

but they show me no value:-(

I'm very thankful for any help.


texts: Magento2 Radio button product custom options

texts:
Adding Radio button to product custom options drop down field, and only one radio button select for n number of add value fields at a time in magento2.

Find the screen shot:


texts:
I am trying to follow the answer of this question Avoiding memory exhaustion when updating product stock? to rewrite a resource model. I created a custom module and is activated in the back-office. Here is my config.xml:

<?xml version="1.0" encoding="UTF-8"?>

 <config>
            <modules>
               <Mymodule_Vendor>
                    <version>0.1.0</version>
                </Mymodule_Vendor_Vendor>
             </modules>

       <models>
            <vendor>
               <class>Mymodule_Vendor_Model</class>
              <resourceModel>vendor_cataloginventory_resource</resourceModel>
      </vendor>

 <cataloginventory_resource>
      <rewrite>
             <stock_item>Mymodule_Vendor_Model_CatalogInventory_Resource_Stock_Item</stock_item>
      </rewrite>
 </cataloginventory_resource>
       </models>

 </config>

When i do this :

$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->setData('is_in_stock', $quantity > 0 ? 1 : 0)->setQty($quantity);
$stockItem->getResource()->saveAttribute($stockItem,array('is_in_stock','qty'));

Directories structure :
app/code/local/Mymodule/Vendor/:
     -Model/CatalogInventory/Resource/Stock : item.php
     -etc : config.xml

I get this error :
Fatal error: Call to undefined method Mage_CatalogInventory_Model_Resource_Stock_Item::saveAttribute()

I solved the error but i got another one:

  Fatal error: Call to a member function loadByProduct() on a non-object

when i try this :

     $quantity = 8;
     $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
     $productId = $product->getId();
     $product = Mage::getModel('catalog/product')->load($productId);
     $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->setData('is_in_stock', $quantity > 0 ? 1 : 0)->setQty($quantity);
 $stockItem->getResource()->saveAttribute($stockItem,array('is_in_stock','qty');

I didn't one to create another question so i edited this one.


texts:
I'm trying to update my Components with magento-cli setup:upgrade and I'm getting an error:

  Notice: Undefined index: websites in
  /opt/bitnami/apps/magento/htdocs/vendor/magento/module-config/App/Config/Type/System.php
  on line 261

I've tried setup:di:compile but the error is still there.

Does anyone know what causes the error?


texts: When will the newest Magento 1.9.1 release?

texts:
Does anyone know when the new version CE 1.9.1 is released?
I will hire a Magento web developer to update my website from version CE 1.4.0.1 to 1.9.1 but I need to know when the new one is released?
Can I update the PayPal Checkout from SSL 3.0 to TSL on my current Magento website 1.4.0.1 and how?


texts:
I have created a custom module.

and I want on Save

<form action="<?php echo $block->getBaseUrl() . 'sales/order/view'; ?> " method="post" enctype="multipart/form-data">

On button click the form should call controller in which I can handle all posted data.

I have tried call controller using basepath, but it always redirect me to admin dashboard.
Update:

class Comment extends \Magento\Sales\Block\Adminhtml\Order\View\Info
{

/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $coreRegistry = null;

public function __construct(
FormKey $formKey, \Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Sales\Helper\Admin $adminHelper,
\Magento\Customer\Api\GroupRepositoryInterface $groupRepository,
\Magento\Customer\Api\CustomerMetadataInterface $metadata,
\Magento\Customer\Model\Metadata\ElementFactory $elementFactory,
\Magento\Sales\Model\Order\Address\Renderer $addressRenderer,
array $data = []
)
{
$this->coreRegistry = $registry;
$this->formkey = $formKey;
$this->_isScopePrivate = true;
$this->_template = 'order/view/comment.phtml';
parent::__construct($context,$registry,$adminHelper, $groupRepository,$metadata,$elementFactory, $addressRenderer,$data);
}

public function getFormKey()
{
return $this->formkey->getFormKey();
}

public function getCurrentOrder(): Order
{
return $this->coreRegistry->registry('current_order');
}

public function getOrderComment(): string
{
    return trim($this->getCurrentOrder()->getData(OrderComment::COMMENT_FIELD_NAME));
}


texts: Programmatically get all products which price greater than 15000INR and assign to category in Admin panel

texts:
I have to get all products which price is greater than 15000INR and assign those products into specific category in Admin panel programmatically.

Looking forward this answer.


texts: We are using Magento Enterprise edition. We can not see the Chinese language option in locale (System -> Configuration -> General -> Locale Options -> Locale). As shown in the attached picture. Can you please help me why it is not showing?


texts: Magento admin panel getting Asymmetric transaction rollback error after remove all product

texts:
When editing  a product and trying to save it, I get the following error message:

Asymmetric transaction rollback error

This error comes after remove all product in admin side so it's scary error comes.  Has anyone else encountered this? Please share the fix :)


texts: Products don't show in categories, only in search

texts:
I am not programmer, but web designer, once I made magento e-store with success.

Now I have problem with products display. They are not visible in Categories, but if I search for SKU or product name, they display, but if I click on it, there is empty page opening

  HTTP ERROR 500

I have searched for solutions without success, and of course, all main settings are correct (visible, in stock, amount, correct category etc.)
I use magento 1.9 and my site is with 3 languages (works ok)

Please help!


texts:
I was thinking about a feature for repeat orders. By repeat orders I mean that I want the customer to eventually click a link that will add the products in the previous order and redirect to cart.

EDIT: As all payments are done externally with credit cards this should just fill the cart with the product and the details. Not to place the actual order

I came across this code in order to add products to cart. However when I run it, none is added.

include '../mydir/mydir/app/Mage.php';
Mage::app();
// Need for start the session
Mage::getSingleton('core/session', array('name' => 'frontend'));
try {
    $product_id = '52'; // Replace id with your product id
    $qty = '4'; // Replace qty with your qty
    $product = Mage::getModel('catalog/product')->load($product_id);
    $cart = Mage::getModel('checkout/cart');
    $cart->init();
    $cart->addProduct($product, array('qty' => $qty));
    $cart->save();
    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
    Mage::getSingleton('core/session')->addSuccess('Product added successfully');
    header('Location: ' . 'index.php/checkout/cart/');
} catch (Exception $e) {
    echo $e->getMessage();
}

It redirects at the end so I don't get any exception. I run this from a sub-domain.


texts: I want to add a delete icon to the global messages in Magento 1.9. But it seems there is no template file for these messages (or at least, I can't find it in my installation and on the internet). Is there a way (preferably not using JavaScript (or jQuery) to append a button) to add a delete button to the messages?


texts: Magento2: OnePageCheckout skip selection of shipping method

texts:
In my project store I have a fixed rate for shipping anywhere (flatrate) but during the checkout process I still have to make the ajax call to select the shipping method.
Is there a way to skip this?
So the shipping method is selected on checkout preperation?

I only found a way to hide the select shipping method form but thats more of a workaround.

Im currently running Magento CE 2.2.4


texts: Magento 1 Config Product Add to cart working for first product only

texts:
Hello,

I have just read csv file and add product to basket but first product adding perfectly with attributes. The issue is starting with second product it is not add to cart with attributes.

Hope you are helping to me. Can you please whats wrong with the code?

foreach ($skus as $key=>$value) {

    $productNew = Mage::getModel('catalog/product')->loadByAttribute('sku',$value);
    $addItionalProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $value);
    if($addItionalProduct == ''){
        Mage::getSingleton('core/session')->addError('Sku of "'.$value.'" Not Found.');
    }else{
        try{
            $productId = $addItionalProduct->getId();
            $cart = Mage::getSingleton('checkout/cart');
            $product = new Mage_Catalog_Model_Product();

            if($addItionalProduct->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE){

                $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($productId);
                $pid = $parentIds[0];
                $configurableProduct = Mage::getModel('catalog/product')->load($pid);
                $productAttributeOptions = $configurableProduct->getTypeInstance(true)->getConfigurableAttributesAsArray($configurableProduct);
                $options = array();

                foreach ($productAttributeOptions as $productAttribute) {
                    $allValues = array_column($productAttribute['values'], 'value_index');
                    $currentProductValue = $addItionalProduct->getData($productAttribute['attribute_code']);
                    if (in_array($currentProductValue, $allValues)) {
                        $options[$productAttribute['attribute_id']] = $currentProductValue;
                    }
                }
                $params = array(
                    'product' => $configurableProduct->getId(),
                    'qty' => 1,
                    'super_attribute' => $options
                );

                $product->load($configurableProduct->getId());
                $cart->addProduct($product, $params);

            }else{
                $params = array(
                    'product' => $productId,
                    'qty' => 1,
                );
                $product->load($productId);
                $cart->addProduct($product, $params);
            }
        }catch(Exception $e){

        }
    }
}

Thanks


texts: I had Magento running on a shared server (hostgater) till I found out that I did not have root access and could not change the php level and various other things. So i cancled my hosting, bought a server and now... I am running Magento 2.2.3 on a fully updated Centos7 in a VM in esxi. (yes I am an IT guy) So my question is what is the best way to set up a mail server with Magento. I think i read somewhere that magento uses php for mail. If that is the case would sendmail be the best option? So my main goal is to have the email come from example@mydomain.com. I am pretty sure that the mail server would have to be installed on the same os and vm as magento correct?


texts:
I'd like to explore the SKU shopping cart rule but I don't have it in my options. I see other people used it and pictures of it but it's nowhere on my list. Is there a way I can enable it?

Using: Magento ver. 1.9.0.1


texts:
How we can get customer id form session if customer is login i use this code but not working:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$customerSession = $objectManager->create("Magento\Customer\Model\Session");
print_r($customerSession);
if($customerSession->isLoggedIn()){
  echo "test".$customerSession->getCustomerId();
}


texts: How to active/deactive a shipping method by code

texts:
I would like to schedule the shipping methods activation/deactivation programmatically.

I've created job correctly but I don't know how to load the shipping method object to call (if it exists) ->setData('is_active', $status) and to save it, as for cms block.

CMS Block Example:

Mage::getModel('cms/block')->load($blocks_to_active[$row])->setData('is_active', $status)->save();


texts: custom magento admin access permission - add product only

texts:
I would like to set up a magento admin user with role permission of adding new product only as well as only be able to modify those products that are added by this user only. Can anyone tell me which file that i need to modify in order to set up this role permission?

Thanks in advance,
jason